Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Want to run both java 1.2 and java 1.5 at the same time  RSS feed

 
parshu ram
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I Want to run both java 1.2 and java 1.5 at the same time. for this I need to set the environment variable JAVA_HOME, but can I set it for both and path for both??? If I do so, how to I know if I use javac which version is running???

Is it possible first of all.....javascript: x()
Confused
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
At the same time ? Not a good idea.
You can have 1.2 and 1.5 on the same machine, and choose which one to use by setting JAVA_HOME and PATH to the correct directory.

If you set both, I think that the one found first in the PATH will be used.
Try "java -version" to check which one is in use.
 
parshu ram
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Satou kurinosuke,

Thanks for your advice, Yes you are correct.

But, I got some applications on, my machine which uses 1.2 ver., I want to work on 1.5. My Idea was not to disturb the existing application. So, as per your advise I should toggle with the JAVA_HOME path when ever I want to work on 1.5. and set back to 1.2 Home when I was to work with the existing applications. Am I correct!!!

-Ram
 
Martin Simons
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you have scripts which start the current application, then modify the script to call the proper java command (directrly out of the jdk/jre directory, and use -cp to set the classpath. In this manner you can run both versions at the same time without a problem.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!