Win a copy of Mastering Corda: Blockchain for Java Developers this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

Add Java 11 without installing or making default.

 
Ranch Hand
Posts: 272
Mac Eclipse IDE Safari
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I develop on MacOS with Eclipse IDE. I would like to add Java 11 to the runtimes available for Eclipse Projects without making it the system default. I use Adopt OpenJDK Java 8 as my system default JDK/Runtime.

Whats the best way to accomplish this to I run the .pkg installer for Java 11 and then re-install Java 8 or should I try and find a zip of the JDK contents which I can extract somewhere ?

Dave
 
Marshal
Posts: 71699
312
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
On a Linux box I would unzip the JDK11 .tar.gz somewhere and not add it to my PATH. Add it to your PATH for the current terminal window as required.
 
Sheriff
Posts: 22055
113
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm with Campbell. Since I moved to AdoptOpenJDK I don't use installers anymore, just the ZIP files (since I'm on Windows).
 
David Garratt
Ranch Hand
Posts: 272
Mac Eclipse IDE Safari
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Many thanks both of you - I will do what you suggest.
 
Saloon Keeper
Posts: 23011
156
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Java's native format is a self-contained ZIP file. You download it, unzip it and it's ready to go.

The installers do 2 things, neither of which are essential.

First, they catalog the product in the system's software inventory. Which is nice, since you can query the inventory database to see what's installed. And in the case of Red Hat RPMs at least, also audit for possible damage to the installation.

Secondly, they help the JDK/JRE live more comfortably in its new home, mostly by adding softlinks so that the Java components look more like native OS product installations.

In the case of the RPM installer, multiple installed JDKs and JVM's are supported by a convention. The installer places the unzipped files in a directory under /usr/java. The directory name corresponds to the Java release ID, so to select a given JDK or JRE you simply explicitly request the Java under the directory you want, or, if you're running something like Tomcat, Maven, or Ant that looks for JAVA_HOME, export the /usr/java/whatever-jbm-release to JAVA_HOME. And incidentally, the RPM installer also makes an alias /usr/java/latest that points to the latest installed JVM.

I've not installed Java under MacOS, but you can reasonably expect similar behavior there.

Even Microsoft Windows can have multiple Java VM's installed, just doesn't have a decent set of OS conventions to manage them. Comes from not being Unix-like.
 
What a stench! Central nervous system shutting down. Save yourself tiny ad!
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic