Actions to be taken when STS (Spring Tool Suite) does not start on MacOS Error details No java virtual machine is not ....

I get an error when starting MacOS Mojave STS and it doesn't start at all! !! Summarize the processing that was sometimes performed! !!

error contents

No java virtual machine was not found after...

When I try to start STS, the above message is displayed and it does not start. In general, it seems that it will start if the following 3 points are implemented ...

  1. Setting environment variables 2.JAVA_JOME
  2. Add JAVA_HOME to the STS .ini file

This article may be helpful for the above points.

Learn the meaning of "passing the PATH" by building a Java development environment on Mac

In my case, setting the above three points did not improve, so I started over from a clean state and it worked. The procedure is as follows.

Step 1 Uninstall java (JDK?) And remove environment variables

I didn't know what was the cause, so I decided to start over from 0. When I checked the inside of the Mac, 3 java (all JDK?) Were included, so first uninstall all.

/Library/Java/JavaVirtualMachines

Since there is a java file under it, move the directory in the terminal and check the version. In my case, there were three.

Delete files one by one with the following command

$ sudo rm -rf /Library/Java/JavaVirtualMachines/jdk name

Check the jdk version below Virtual Machines in your own terminal and execute the delete command.

Step 2 Delete the set environment variables

PATH JAVA_HOME Since I had set the above two variables, I deleted both of them. Click here for the delete command.

$ unset hogehoge....



 Substitute what you want to delete in the hogehoge part. However,

```$ unset path```

 Note that if you enter, you will not even be able to cd in the terminal. I think there are multiple PATHs, but they are separated by a colon (:). Let's delete only the PATH related to java.

 Also, I added the above two points to the bash file, so I deleted them as well.

# Step 3 Uninstall STS as well
 This is also deleted. This is recommended if you want to uninstall the app on your Mac.
[App Cleaner](https://appcleaner.softonic.jp/mac)


# Step 4 Reinstall jdk and STS
 Download and install amazon-coretto-8.jdk from the amazon page. Then download and install STS again

 After executing up to this point and confirming the startup of STS, it started up safely.
 STS starts up even if the environment variable is not set ... Then ...!? (Guon !!)

 The detailed cause is unknown, but it may have been wrong to put multiple java (jdk?) ... So if you are in the same situation, Oraoraaaa! !! Try removing all and jdk before trying.






Recommended Posts

Actions to be taken when STS (Spring Tool Suite) does not start on MacOS Error details No java virtual machine is not ....
[Grails] Error occurred running What to do when the Grails CLI does not start
What to do when is invalid because it does not start with a'-'
Put Java 11 and spring tool suite on mac
JAVA + STS (Spring Tool Suite) environment construction procedure
Eclipse does not start after Java 11 is installed