0

I'm new to Java and found it's hard to install on my Mac. I read similar past questions and tried their solutions, but none works.

So far, I installed the latest version of jdk-14 and use eclipse-java-mars-2-macosx-cocoa-x86_64.tar. Also, I tried add -vm to eclipse.ini. Now it's like:

-startup
../Eclipse/plugins/org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar
--launcher.library
../Eclipse/plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.1.300.v20150602-1417
-product
org.eclipse.epp.package.java.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vm
"/Library/Java/JavaVirtualMachines/jdk-14.jdk/Contents/Home/bin"
-vmargs
-Dosgi.requiredJavaVersion=1.7
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts
-XX:MaxPermSize=256m
-Xms256m
-Xmx1024m
-Xdock:icon=../Resources/Eclipse.icns
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts

But still got error message saying A Java Runtime Environment (JRE) or Java Development Kit (JDK) must be available in order to run Eclipse. error message

Yet without this line, the error is "Failed to create the Java Virtual Machine".

Any help will be appreciated!!

  • What's the use of that `vm` option? – Minh Nghĩa Mar 24 '20 at 03:15
  • While, without it the error is "Failed to create the Java Virtual Machine". I searched on line and a common suggestion is adding -vm PATH. – Stephanie Yang Mar 24 '20 at 03:29
  • Check if the folder exists and if a `java` executable exist in the folder. Or just uninstall them all, then use [Homebrew](https://brew.sh/) to install, you'll need it sooner or later. Just paste the line in the webpage to Terminal to install brew, then `brew cask install eclipse-java`. Package managers like Homebrew will handle the rest for you. – Minh Nghĩa Mar 24 '20 at 04:00
  • No need for Homebrew, that is overkill. Delete all the JVMs currently found in `"/Library/Java/JavaVirtualMachines/`. Then head to AdoptOpenJDK and download a Mac-specific installer. Easy-peasey. But use the long-term support LTS version of Java, Java 11. Wait on Java 14 until it has been proven to work well with Eclipse. – Basil Bourque Mar 24 '20 at 05:21
  • 1
    Eclipse doesn't current run with Java 14. That is a very old version of Eclipse - use the current 2020-03 – greg-449 Mar 24 '20 at 08:53
  • 1
    Note that if you insist on running Eclipse Mars (5 years and 10 releases old) then you must use Java 8, anything later will not work. – greg-449 Mar 24 '20 at 09:59

0 Answers0