• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is it possible to use multiple JDK's?

 
john price
Ranch Hand
Posts: 495
Chrome Java Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to use multiple JDK's? I need two because of clients that won't upgrade yet. I need to have 2 JDK's, working and installed. Would I just have to keep switching the path to the different versions? I need one for personal projects (and testing) and one for projects to be released.
 
Rob Spoor
Sheriff
Pie
Posts: 20372
44
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Correct. I've had a Java 1.4 and a Java 6 JDK installed simultaneous for years at work. Right now, at home I have a Java 6 and a Java 7 JDK installed. To start using the Java 7 JDK all I had to do was modify the JAVA_HOME variable, as that's what I'm using inside the PATH variable.
 
john price
Ranch Hand
Posts: 495
Chrome Java Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cool, thanks! Is there an easy way to modify the variables? In Windows, without going to the "Environment Variables". Aka, is there a command I can type to change the variable?
Thanks,
John Price
 
Campbell Ritchie
Sheriff
Pie
Posts: 47229
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try
set PATH="C:\Program Files\jdk1.2.3_04\bin";$PATH$
or similar when you open your command line.
 
Campbell Ritchie
Sheriff
Pie
Posts: 47229
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If $PATH$ doesn't work try %PATH% instead. Sorry for the mistake.
 
Campbell Ritchie
Sheriff
Pie
Posts: 47229
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can also declare the path in full whenever you invoke a command. Instead of writing java Foo try "C:\Program Files\java\jdk1.2.3_45\bin\java" Foo
You may need quote marks because the path includes spaces.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic