Spring STS 3.7.2 "No Java virtual Machine Found" on Mac OS X Yosemite - eclipse

I have been using Spring STS 3.7.2 for a few months on my Mac laptop (Mac OS X Yosemite 10.10.5). But suddenly the STS IDE is not starting up. I suspect that one of the automatic OS update may have changed something, since I noticed that I don't see java any more on my path setting.
I manually added the following entries to my .bash_profile and updated using source command:
export PATH=$PATH:/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre/bin
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home
But STS stubbornly not working. It keeps giving me the error message in a dialog box:
A java runtime environment (JRE) or Java development kit (JDK) must
be available in order to run STS. No Java virtual machine was found
after searching ....
I am confused. I am able to invoke java from any terminal window, as well as JAVA_HOME environment variable is set.
Any ideas what may be going on?

After quite a bit of searching online, I figured out the problem, and resolved it for myself. It basically boils down to JDK upgrade to versions beyond 1.6.
The following link provided a solution:
https://apple.stackexchange.com/questions/178647/jdk-platform-not-recognized-running-eclipse-or-mvn
Here are the steps:
Revert back to JDK 1.6: Download and install JDK 1.6 from this Apple site: https://support.apple.com/kb/DL1572?locale=en_US
Change the PATH variable to point to the 'bin' directory of where JDK is installed. On my Mac, it was installed at: /Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin
Go to the STS application installed directory and run the command "open -a STS.app". This will open the STS IDE successfully.
Exit STS.
Now, if you want to use Java 8, then change the PATH variable to the Java 8 directory. On my Mac, it was at: /Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/bin
Launch the STS app again, and voila!, the problem solved.

Related

Eclipse error 'UseStringDeduplication'

I installed a fresh Ubuntu 16.04 VM, Oracle JDK 7, and downloaded the latest Eclipse. But I am getting this error when I try to start Eclipse:
Unrecognized VM option 'UseStringDeduplication'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.
Why am I getting this error on a fresh install? And is it a bad idea to remove that VM option?
Latest version of Eclipse (Neon) requires Java 8 runtime, and the Eclipse website obnoxiously neglects to mention it anywhere from the homepage to the download link for Eclipse, not even a version warning at runtime for Eclipse.
Same error for me in Kubuntu 14.04, eclipse Neon,
I Removed -XX:+UseStringDeduplication from .ini file, it works for me
I know, i'm little to late to the party. I got this issue lately on my Mac. I updated my eclipse (from Mars to Oxygen) all of the sudden i couldn't start my old project. First i thought, this must have something to do with the new eclipse, which wasn't all wrong. Because eclipse.ini file of Oxygen expected java-1.8.
I updated my java to latest (jdk1.8.0_152.jdk), but the problem remained, than i removed these parameters from the eclipse.ini, still was the same, i checked the "Run Configurations" and basically removed the same parameters from the arguments list. Now my projects seem to work just fine. I also needed to restore the platform, since Oxygen use e.4-platform.
Remove these parameters from eclipse.ini file
Select the project and go to "Run As"->"Run Configurations..."-> "Arguments" check the old configurations under "VM arguments" (it can be a product in case of an RCP-project)
removed the VM-option(s)(actually, they can be more) not recognized and "Apply"-> "Run".
I got the same error when I have installed Java 8 and Java 9 in my Ubuntu 16.04. My eclipse version was Neon. As https://wiki.eclipse.org/Eclipse/Installation#Eclipse_4.6_.28Neon.29 describes to start specific eclipse ide you need relevant JDK. For neon, it was Java 8. Since I installed Java 9 using apt-get it was the default JDK. so I have to change the default JDK to Java 8.
You can check which java version used in system-wide with
java -version
`If you want to see which are the versions of JDK installed in Ubuntu then run below command in shell.
sudo update-java-alternatives --list
Then choose which version you want to set. After that run below command.
sudo update-java-alternatives --set [JDK/JRE name e.g. java-8-oracle]
Now run again Eclipse. if the version was the reason to conflict, it will run now. Referred by http://menukanows.com/how-to-set-a-default-jdk-version-in-ubuntu/
String Deduplication – A new feature in Java 8 Update 20
It means you should nt java 1.8 updated later or equal 20.
I faced the same issue on Eclipse Oxygen in Ubuntu.
Tried:
Checking java version (It was already at 1.8.0 so according to the accepted answer, it should work.)
Removing -XX:+UseStringDeduplication from .ini file
Still didn't solve the problem. Then I saw #simgineer's comment:
In my case this was for eclipse oxygen. I had an older version of java
8 installed (jdk1.8.0_05) when I upgraded to the latest (jdk1.8.0_151)
and updated my eclipse.ini to point to the latest as well (since it is
recorded in there during installation) eclipse oxygen started working.
Solution:
Updated JDK from 1.8.0 to jdk1.8.0_231 and it got resolved.
Voila! I didn't have to update anything in my eclipse.ini .

what is the eclipse compatible version for openjdk1.7 in windows 7 64 bit OS

I have windows 7 64 bit OS in which I used to work with eclipse Juno Service Release2 version and Oracle JDK 1.7. Now as per my new project requirements I had to change my JDK from Oracle JDK to OpenJDK 1.7. I have un-installed all the other jdk's from my machine and installed OpenJDK1.7(64 bit version). Now I am facing issues with eclipse, I am able to open eclipse IDE but if I perform any operations like opening an existing project or trying to run any programs/project it is getting crashed or getting hanged. I have to end the process from the taskbar and try again and again. Below is the popup screen that I am getting after eclipse crashes.
Can some one tell me how to resolve this issue? I have seen some blogs saying there is a bug with eclise and OpenJDK with Ubuntu and mac OS but no issues reported for windows. So if there is way to fix this issue please let me know (or) please suggest any eclipse version the is compatible with OpenJDK1.7 and windows7.
Here is my version of solution to my issue which was mentioned above.
Installed Oracle JDK1.7 on my system and did not set the path for this. I have updated the eclipse.ini file with (found in eclipse root directory)
-vm
C:/Program Files/Java/jdk1.7.0_79/bin/javaw.exe parameter. so that Eclipse starts with Oracle jdk
and in
Eclipse->Windows->Preferences window
under Java->Installed JREs->Add(under Installed JREs)
added a new entry to point out the OpenJDK1.7 version so that my project uses OpenJDK version. This solved unusual crashing of Eclipse

eclipse is not installing at all

I've installed jdk-8u65-windows-i586.exe and downloaded the latest version of Eclipse IDE.
When I double click on the eclipse-inst-win31.exe absolutely nothing happens.
MY OS is Windows Vista.
How can I resolve this problem?
Make sure you have a working java sdk in java_home variable - type java - version in cmd prompt
If you don't, reinstall java sdk and eclipse it should start.
Instead of using the Eclipse installer (which is still a rather new part of the Eclipse downloads), just take one of the complete distributions (scroll down below the installer on the download page).
While the installer first needs to download additional pieces from the Internet, those distributions are ready to start developing.

QML Preview compatibility check failed. QML preview is disabled

I am on Mac 10.8.2, i have both java 1.6 (32/64bit enabled) and java 1.7 on my machine and the JAVA_HOME is pointed to java 1.6, but whenever I try to enable QML previewing in my momentics ide (QNX® Momentics® IDE for BlackBerry® 10 Native SDK, Version: 10.0.9), I get the error in the Title. looked a bit into the log under workspace/.metadata/.log, and it logged the following:
!MESSAGE QML Preview compatibility check log.
Error: This Java instance does not support a 32-bit JVM.
How can I get the ide to point to java 1.6? Is it somewhere in the startup script of the application that I can change?
Thanks
QNX Momentics is based on Eclipse, so you should be able to change the JVM used by editing the .ini file for the IDE. If your Momentics is installed in the default location, in Finder navigate to:
/Applications/bbndk/ide/macosx/x86/eclipse/
Right click on qde.app (if you have extension hidden it might just be qde with the momentics icon) and choose Show Package Contents.
Under /Contents/MacOS/ edit the qde.ini file in TextEdit.
At the top of the file, before -vmargs add the following:
-vm
/path/to/your/java/jvm/here
ie.
-vm
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java
Save the file and launch Momentics, and it should now be using the JVM you specified. Check your workspace/.metadata/.log after the startup to confirm this.
I've met the same problem with you, I've tried #nonesuchnick 's answer but unfortunately that did not work for me.
And I've similar environment with you: I've got Java 1.7 (the Oracle one) and 1.6 (the Apple one) installed on my Mac (10.8.2).
I resolved my problem via this way:
Delete Java 1.7 completely
Check your NDK installer's md5 to ensure you've got the correct one.
To delete Java 1.7 completely, you'll need to delete the jdk1.7 folder under
/Library/Java/JavaVirtualMachines/
and delete the internet plugin JavaAppletPlugin.plugin under
/Library/Internet Plug-Ins
Then open terminal and type java -version to make sure that your PATH variables is correctly set to your java 1.6 path (I mean the Apple one).
Upon finish this, you can try to uninstall the BB10 NDK and reinstall it, then try to enable the QML Preview, this time it should work.
Reference:
How do I uninstall Java 7 for my Mac?

Cannot run the project in Eclipse on Mac

Exception occurred executing command line.
Cannot run program "/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java"
(in directory "/Users/zhangstudyro/Developer/Java/HiWorld"): error=2, No such file or directory
Hi, I'm new to mac.
The report above is the problem details given by eclipse when I tried to run "HiWorld".
I can "javac" and "java" the code in Terminal. And in eclipse, I've added JDK1.6.0 which is the default JDK version to the Build Path Libraries.
Googled and SOFed for hours, but I'm still perplexed with my Eclipse on Mac.
I had the same issue with Intellij. I fixed it by changing the path to the JDK.
For me, the issue was cause by Apple changing the JDK's location when my work computer got upgraded to the latest version of Mac OS X. The new path for my JDk looks the same, but doesn't start with "/System".