Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

STS : Failure to create Java Virtual Machine

I am unable to start my STS (Spring Tool Suite) on my new macOS - High Sierra Version - 10.13.6

The following are the contents of my STS.ini file -startup ../Eclipse/plugins/org.eclipse.equinox.launcher_1.4.0.v20161219-1356.jar --launcher.library ../Eclipse/plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.1.551.v20171108-1834 -product org.springsource.sts.ide --launcher.defaultAction openFile -vmargs -Dosgi.requiredJavaVersion=1.8 --add-modules=ALL-SYSTEM -Xms384m -Dosgi.module.lock.timeout=10 -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts -Xdock:icon=../Resources/sts.icns -Xmx1200m -XX:+UseCompressedOops

  1. Java version - openjdk version "1.8.0_144"
  2. STS version - 3.9.6
  3. Mac Version - 10.13.6

Tried adding -vm option with value /Library/Java/JavaVirtualMachines/1.8.144_1_openJDK_macosx.jdk/Contents/Home and changing Xmx/Xms to different values in my STS.ini but nothing worked. Any suggestions?

like image 399
saranya elumalai Avatar asked Dec 17 '22 20:12

saranya elumalai


2 Answers

Faced a similar issue when I upgraded Java from Java 8 to openjdk 14. I resolved it by doing the following:

Open /Applications/SpringToolSuite4.app/Contents/Eclipse/SpringToolSuite4.ini

Add the following lines to the start of the file and save it:

-vm
/Library/Java/JavaVirtualMachines/openjdk-14.jdk/Contents/Home/bin/java

Now, you need to point the softlink of libjli.dylib inside /Library/Java/JavaVirtualMachines/openjdk-14.jdk/Contents/MacOS/ to the right location. To do that, do the following:

cd /Library/Java/JavaVirtualMachines/openjdk-14.jdk/Contents/MacOS/
sudo rm libjli.dylib 
sudo ln -s /Library/Java/JavaVirtualMachines/openjdk-14.jdk/Contents/Home/lib/libjli.dylib libjli.dylib

Now, try opening SpringToolSuite4 and it should work seamlessly. If you are using another version of jdk, make sure that the path is chosen correctly in the ini file as well as the softlink creation part. Note: You do not need to play around with vmargs to adjust the -Xms and -Xmx args to resolve this.

like image 130
Kavitha Karunakaran Avatar answered Dec 31 '22 10:12

Kavitha Karunakaran


open file /Applications/SpringToolSuite4.app/Contents/Eclipse/SpringToolSuite4.ini

add

--launcher.appendVmargs
-vm
/Library/Java/JavaVirtualMachines/jdk-11.0.2.jdk/Contents/Home/bin/java
like image 26
willx lopez Avatar answered Dec 31 '22 09:12

willx lopez