How to point to other JAVA version in RAD eclipse

Alvin picture Alvin · Oct 2, 2012 · Viewed 9.9k times · Source

I saw that this has been asked before but in a way different situation than mine. Anyway, originally the Java version that was used by my RAD was 1.3, I also pointed originally my JAVA_HOME to the 1.3 which is located here : C:\IBM\SDP70\jdk

Now I changed my JAVA_HOME to: C:\Java\jdk1.6.0_34 and my CLASSPATH to: C:\Java\jdk1.6.0_34\bin and added the CLASSPATH to my PATH.

So, when I check my java version in cmd it is 1.6. These info might not be related but I stated it anyways.

As for the eclipse of RAD, Under preferences > Java > Compiler:

*JDK Compliance
Compiler compliance level: 6.0
checked - Use default compliance settings
Generated .class files compatibility is 6.0*

and for installed JREs :

*checked - Java 1.6 Location - C:\Java\jdk1.6.0_34*

Sorry I cannot paste an image here yet.

BUT still when I run my program using generics, I still received this problem.

C:\IBM\SDP70\runtimes\base_v61\profiles\AppSrv01\temp\SGSETSCIMPB501Node01\server1  
\cimwebEAR\cimweb.war\prodctl\_login.java : 91 : The type List is not generic; it 
cannot be parameterized with arguments <Map>JSPG0091E: An error occurred at line: 22 
in the file: /prodctl/login.jspJSPG0093E: Generated servlet error from file: /prodctl
/login.jsp 

C:\IBM\SDP70\runtimes\base_v61\profiles\AppSrv01\temp\SGSETSCIMPB501Node01
\server1\cimwebEAR\cimweb.war\prodctl\_login.java : 91 : Syntax error, parameterized 
types are only available if source level is 5.0

I think it is still pointing to 1.3 and I don't know how to change it now.

Answer

Eric B. picture Eric B. · Oct 2, 2012

A few things you can check:

  1. Check the eclipse.ini for a -vm argument. It may specify a different VM. However, this is just the VM that is used to launch eclipse and not necessarily the one that is being used for your project.
  2. Check that your Preferences -> Installed JREs has your 1.6 jdk set as the default
  3. Check the build path libraries for your project (you may have another JRE being used as the project JRE)
  4. You don't specify if this is a maven project. If so, you might have some settings in your pom.xml that specifies that it is a 1.3 JRE