Reputation: 2054
This might be a very stupid question but bear with me since I am new to Java/J2EE. I have installed JRE6 and JRE7 on my machine. I have set JAVA_HOME environment variable to point to my JRE6 directory. Also, in my eclipse, I have pointed the working JRE to JRE6. However, if run "java -version" in the terminal, it says current java version is 1.7 (pointing to JRE7).
The problem I am actually facing is that eclipse gives me errors for the following iunterface:-
public interface IServiceHelper {
public <T extends Document> Document SomeMethod(Object obj);
// Error - Duplicate method SomeMethod(Object) in type IServiceHelper
public <T extends SomeClass> SomeClass SomeMethod(Object obj);
// Error - Duplicate method SomeMethod(Object) in type IServiceHelper
public <T extends String> String SomeMethod(Object obj);
}
However, a maven build outside of eclipse in a terminal succeeds.
The above interface may not be a good design and may be really some tricky code. Since this is an existing piece of code, I am not supposed to make changes. Please help me find out what is wrong with eclipse and/or JRE version.
Upvotes: 1
Views: 1424
Reputation: 140
If you have mess with Java versions on your machine you can easily set up which Java eclipse will use. Edit file /eclipse.ini Add: -vm PATH_TO_YOUR_JAVAW_EXECUTABLE
From Eclipse FAQ: If a JVM is installed in the eclipse/jre directory, Eclipse will use it; otherwise the launcher will consult the eclipse.ini file and the system path variable. Eclipse DOES NOT consult the JAVA_HOME environment variable.
To explicitly specify a JVM of your choice, you can use the -vm command line argument:
eclipse -vm c:\jre\bin\javaw.exe ''start Java by executing the specified java executable
http://wiki.eclipse.org/FAQ_How_do_I_run_Eclipse%3F
Upvotes: 0
Reputation: 2427
There are a couple of things here:
Upvotes: 2