aspose file tools*
The moose likes Features new in Java 7 and the fly likes Is it possible to use multiple JDK's? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Features new in Java 7
Bookmark "Is it possible to use multiple JDK Watch "Is it possible to use multiple JDK New topic
Author

Is it possible to use multiple JDK's?

john price
Ranch Hand

Joined: Feb 24, 2011
Posts: 495

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.

“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” (Mosher's Law of Software Engineering)
“If debugging is the process of removing bugs, then programming must be the process of putting them in.” (Edsger Dijkstra)
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19541
    
  16

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.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
john price
Ranch Hand

Joined: Feb 24, 2011
Posts: 495

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

Joined: Oct 13, 2005
Posts: 36478
    
  16
Try
set PATH="C:\Program Files\jdk1.2.3_04\bin";$PATH$
or similar when you open your command line.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36478
    
  16
If $PATH$ doesn't work try %PATH% instead. Sorry for the mistake.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36478
    
  16
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is it possible to use multiple JDK's?
 
Similar Threads
Organizing multiple projects in SVN
Error : java.lang.ClassFormatError: Incompatible magic value 13375 in class file
A valid question
Factors to be considered for creating custom hashmap
Exception in displaying data in a pdf format