Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can we have multiple Java SDKs in one machine?

Tags:

java

version

sdk

Can I have multiple java SDK versions installed on my machine?

Java 1.4 Java 2 Java 6 Java 7

please advise as I have to develop solutions for Maximo in Java 1.4 and Java 2 Plus I want to learn development on Java 6 and 7

Thanks.

like image 301
user606093 Avatar asked Dec 07 '11 11:12

user606093


3 Answers

I attach some pics as how I configured VS code to work with two different versions of Java in one machine

1-Environment Variables

2-Configuration inside VS Code

3-Configuration inside VS Code

4-Configuration inside VS Code

like image 187
S Satyen Avatar answered Oct 22 '22 04:10

S Satyen


Yes,you can. You need change environment variable Normally JAVA_HOME variable. So 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
like image 37
Zealous System Avatar answered Oct 22 '22 03:10

Zealous System


Can I have multiple java SDK versions installed on my machine?

Yes

But make sure you use right path in your projects. It will be better to use some IDE like Eclipse. It will handle jdk path problems for you.


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

like image 42
Harry Joy Avatar answered Oct 22 '22 03:10

Harry Joy