Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Installing jdk 1.6 as well as 1.4.2 - possible ?  RSS feed

 
Edward Kin
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just a quick question on installing multiple jdk's. We run 1.4.2 at work but am keen to study for the SCJP exam and would like to be able to run 1.6 too.

I was going to download jdk-6u17-windows-i586.exe and then choose a directory to install it to and then create a new project in eclipse and select the jdk that I want (1.6).

Is this ok or will it foul up work settings ?!
Thanks,
Ed
 
Campbell Ritchie
Marshal
Posts: 56193
171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to set the version you are using first in your PATH variable. There is a way to set the PATH for the lifetime of your terminal window/command prompt, which is something like

export PATH=/usr/java/jdk1.4.2_12/bin/:$PATH

on Unix/Linux, or

set path=c:\Program Files\Java\jdk1.4.2_12\bin;%path%

or something rather similar on Windows. By doing so you can put your 1.4 or your Java6 installations first in the PATH and use them in turn.

I am sure somebody will know the correct syntax to use for windows and correct what I have written. Or you can search; there are lots of similar installation questions here on beginning Java.
 
Edward Kin
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply - have worked it out now - pretty straightforward but wanted to be a bit cautious.
Downloaded the sdk for 6 and the documentation (not sure why it's separate) and then can just reference it through the cmd line (windows as outlined above - just setting the path for the session) or I can use eclipse by creating a new project and selecting the jre/compliance level in the project properties.
Thanks again - Ed
 
Campbell Ritchie
Marshal
Posts: 56193
171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well done getting it working. The documentation is intended to be used online, so most of us don't download it.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!