Results 1 to 3 of 3
- 04-26-2010, 07:25 PM #1
Member
- Join Date
- Apr 2010
- Posts
- 2
- Rep Power
- 0
Compile problem when switching Java versions
I am using alternatives to manager two versions of Java (1.5.0_10 and 1.6.0_16) on a RHEL5 machine. I hadn't been having any problems switching versions until just last week. When I executed "alternatives --config java" and changed the version to 1.6, I would run "java -version" but the version displayed would still be 1.5. So someone suggested removing JAVA_HOME (which had been set to the path of JDK 1.5) from the PATH environment variable. This actually solved the problem I was having but created another one. Now I am unable to compile any code (I get "-bash: javac: command not found"). I know for a fact that the path to JDK 1.6 is legit because "java -jar" is working (plus it wouldn't have even given me a version number if it had been wrong).
Any suggestions?
Thanks,
Brian
- 04-26-2010, 08:09 PM #2
Senior Member
- Join Date
- Mar 2010
- Posts
- 953
- Rep Power
- 4
The fact that java -jar works proves that the JRE paths are good, but doesn't give you any evidence about the JDK paths. If javac cannot be found, then your PATH environment variable is still wrong (or you don't have a JDK installed).
-Gary-
- 04-26-2010, 09:12 PM #3
Member
- Join Date
- Apr 2010
- Posts
- 2
- Rep Power
- 0
I finally found a way to completely reset the java alternative symbolic links (rm /var/lib/alternatives/java) and then I went through the process of installing the various java versions. I did the same for javac (which I had never done before), and after this I was able to switch versions without any issues.
Similar Threads
-
Java Versions
By hiranya in forum New To JavaReplies: 6Last Post: 10-27-2009, 12:42 PM -
Think I broke Eclipse trying to switch Java versions
By zacf in forum EclipseReplies: 4Last Post: 01-01-2009, 04:21 PM -
Switching Careers to Java? It's never to late, is it?
By /-ICEpik in forum Jobs DiscussionReplies: 10Last Post: 12-30-2008, 05:03 PM -
Can I delete/uninstall older versions of Java?
By LudwigKarl in forum New To JavaReplies: 3Last Post: 03-19-2008, 10:23 AM -
Using different versions of Java
By javaplus in forum New To JavaReplies: 2Last Post: 01-04-2008, 08:28 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks