2

I have openJDK 1.8 installed and I need Sun's JDK 1.6 for a project (I also need Java 8 for my IDE but it cna be either openJDK or Sun's). Do I need to uninstall openJDK or can they exist side by side?

Don Rhummy
  • 24,730
  • 42
  • 175
  • 330

3 Answers3

0

yes, you can. But JAVA_HOME can lead to only one instance (and only one %JAVA_HOME%/bin directory should be added to PATH env var)

Cootri
  • 3,806
  • 20
  • 30
0

For sure you can install multiple JDKs at a time, yet only one of them may be set as default java (JAVA_HOME). This would be called if you type java myProgramName.

If you want to be sure to run a certain program with a certain JDK, run them with /full/path/to/my/jdk/bin/java myProgramName.

Markus Weninger
  • 11,931
  • 7
  • 64
  • 137
0

They can exists side by side. Eclipse (for instance) allows you to have multiple VM's installed, and pick between them on a project-by-project basis. Other IDE's probably have similar capabilities.

enter image description here

AJNeufeld
  • 8,526
  • 1
  • 25
  • 44
  • I know you can run multiple Sun JDK's side by side, but I saw online people having issues running it alongside openJDK. – Don Rhummy Mar 31 '16 at 19:06