Can we have multiple Java SDKs in one machine?

后端 未结 5 1299
天涯浪人
天涯浪人 2021-02-06 06:56

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

相关标签:
5条回答
  • 2021-02-06 07:05

    Yeah, you can install as many Java SDKs as you want. When you develop you just use the JDK you want to use.

    0 讨论(0)
  • 2021-02-06 07:13

    Yes, you can. Just use full path names when invoking javac, java, etc. or set your PATH environment variable to point to the appropriate jdk/bin location.

    The IDEs usually allow defining multiple JDKs/JREs, and you can choose which one to use for every project.

    0 讨论(0)
  • 2021-02-06 07:15

    Yes you can. JDK is merely a directory somewhere on your disk. So you can easily download and unpack all the versions you want, and run java and javac from the directory you're currently interested in.

    IDEs will do all the messy stuff for you: just let them know where the unpacked JDKs are, and choose a JDK in project's or module's settings.

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

    0 讨论(0)
  • 2021-02-06 07:19

    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
    
    0 讨论(0)
  • 2021-02-06 07:21

    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.

    0 讨论(0)
提交回复
热议问题