Having multiple Java SDKs on the same machine

Can I install several java versions of the SDK on my machine?

Java 1.4 Java 2 Java 6 Java 7

please tell me how I need to develop solutions for Maximo in Java 1.4 and Java 2 Plus I want to learn development in Java 6 and 7

Thanks.

+4
source share
5 answers

Can I install several java versions of the SDK on my machine?

Yes

But make sure you use the right path in your projects. It is better to use some IDE, such as Eclipse . It will handle jdk path problems for you.


Java 1.4 is very old, try to switch to a new one as soon as possible.

+3
source

Yes, you can. You need a change environment variable. Usually the JAVA_HOME variable. That way you can use another variable. eg.

JAVA_HOME='/home/jdk1.8.0_45' JAVA_7='/home/jdk1.7.0_60' JAVA_6='/home/jdk1.6.0_34' 

Add path variable

 PATH=$PATH:$JAVA_HOME/bin PATH=$PATH:$JAVA_7/bin PATH=$PATH:$JAVA_8/bin 
+3
source

Yes, you can. Just use full pathnames when calling javac , java , etc. Or set the PATH environment variable to the appropriate jdk/bin location.

Typically, IDEs allow you to define multiple JDK / JREs, and you can choose which one to use for each project.

+2
source

Yes, you can install as many Java SDKs as you want. When you develop, you simply use the JDK that you want to use.

+1
source

Yes, you can. JDK is just a directory somewhere on your drive. Thus, you can easily download and unzip all the versions you need and run java and javac from the directory you are interested in.

The IDE will do all the useless things for you: just tell them where the unpacked JDKs are located and select the JDK in the project or module settings.

PS. Java 1.4 is Java 2. Java 2 is actually an umbrella name for 1.2, 1.3, and 1.4.

+1
source

Source: https://habr.com/ru/post/1385088/


All Articles