How install multiple JDK on Windows?

前端 未结 5 2173
抹茶落季
抹茶落季 2020-12-14 02:41

I want to install JDK 1.5 and 1.6 on XP, is it possible? how to do it

Also, I am using Eclipse how to setup using different JDK for different projects?

thank

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-14 03:21

    There was a big mess with different incompatible JDK and JRE from 90s when Java was created and still this problem exists. The main rule is when you type in console:

    java -version

    and

    javac -version

    the result should be the same then you sure both JRE and JDK (JSDK) are compatible, so when you compile you can rut it without any problems.

    JAVA_HOME and PATH are essential for many console applications and some GUI tools might use those variables as well but often is possible to alter default settings in GUI application instead of messing with environment variables. Also CLASSPATH still sometimes are used as well, however better use ANT as compiler than javac directly.

    You can install multiple JDK and JRE but each one should to have its own separate folder, the default should be usually ok.

    Worth mentioning that every JDK have JRE included and it instal in separate folder and as separate APP in Windows Control Panel -> Applications to be more confusing, so basically developer will never have to download and install JRE. Do not use Java update application which might cause problems after update some apps might not work, just do it manually.

提交回复
热议问题