Win a copy of TensorFlow 2.0 in Action this week in the Artificial Intelligence and Machine Learning 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 ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

Multiple Eclipse icons?

Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hope I'm in correct forum section...

Is it possible to have multiple Eclipse icons? My goal is to have two Eclipse icons, one which will be associated with workspace(s) for developing Java EE apps, and the other one for Java GUI,Desktop apps, that is SE.

Is there any way on how to achieve this? TA told us to install JDK 1.8 (since we'll be working with Apache Tomcat "some version") and we need to have that one installed. However, I want for my side projects (and for practicing purposes) to use jdk 1.12. Also, I want in that workspace, (which will be use for side projects), to be able to switch between different jdks. That is, to be able to use "Build path" option in Eclipse, and to choose for different projects to develop them either in jdk 1.8 or jdk 1.12. For now, my JAVA_HOME variable is set to be C:\Program Files\Java\jdk1.8.0_221.

Also, when I type in cmd where java I get:
C:\Program Files\Java\jdk1.8.0_221\bin\java.exe
C:\Program Files\Java\jdk-12.0.2\bin\java.exe

I tried to install two Eclipse packages, one for Java SE and one for Java EE. That didn't go well. I got some message when I tried to open Eclipse for Java SE: "Couldn't find MainClass..."

Staff note (Bear Bibeault) :

Moved to the Eclipse forum.

author & internet detective
Posts: 40241
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use the same Eclipse with different workspaces. And if you have them both open, you have two windows with different settings.

Don't worry about your Java home. In your "side projects" workspaces, open the workspace preferences and search for "installed JREs". That will let you configure multiple versions of Java and switch
Saloon Keeper
Posts: 22668
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JAVA_HOME is not an official part of Java. It's a convention that many - but by no means all - Java applications use to locate a particular JVM. In many cases, such as Tomcat, the app is actually launched via a shell script, and JAVA_HOME is an environment variable, which is something that shell scripts like to use for reference purposes. Also, each instance of a shell can have its own environment variable set, so you can set a JAVA_HOME in one shell window that points to a completely different Java version than what another command shell is using. It's a bit trickier when launching from a GUI desktop icon, but even there there are ways.

In particular, Eclipse doesn't use JAVA_HOME as the basis for running Eclipse (which is after all written in Java) itself. Instead Eclipse has a master configuration file to allow it to use the desired JVM version.

As Jean has said, Eclipse doesn't require projects in an Eclipse workspace to use the same JVM code that Eclipse itself is using. You can install and use a different JVM for each project in the workspace. Essentially, you're defining a dictionary in Eclipse that associates a JVM location (and optional properties) with a symbolic name that you then reference in a project's properties.
This looks like a job for .... legal tender! It says so right in this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic