Mac OS: can't install Eclipse [duplicate] - eclipse

I have formatted my Mac due to some storage issues. Before this, I used Eclipse in a proper way. Now i have installed the JDK
Then, i have installed Java
Until now everything seems to be correct but when I open the Eclipse installer...
What can I do to fix this? I need to work with this the soon as possible.
Thanks

Eclipse on macOS will not start with Java 14 installed, this is being tracked in Eclipse bug 561273.
Installing Java 8 as well does not help. You need to remove the Java 14 install. You could use the Java 13.0.2 release instead.
Eclipse have determined that the root cause of this issue is a change in Java 14 which is described in this bug report JDK-8238225. The fix for this should be in Java 14.0.1
Update: Eclipse runs fine with Oracle Java 14.0.1 so the issue has been fixed.

I also asked this question which was closed, that's why I answer what I have found out: Eclipse will not install on Mac OS Catalina 10.15.4, saying the above error message
Failed to create the Java Virtual Machine.
Deinstalling jdk and install an older one wouldn't help on its own because Eclipse is refusing to install in the first place (as mentioned above). What I have done:
i´ve installed an JDK with boost (you can try several, mine worked with Version 13)
I edited the installer:
Download the dmg file
convert the dmg-file with "hdiutil convert /dev/disk3s1 -format UDRW -o devimage"
mount the converted dmg-file with: "hdiutil attach -owners on devimage.dmg -shadow"
Edit the /Volumes/Eclipse/Eclipse.app/Contents/Info.plist: there is a section which is commented and there you can try the jdk version. You have to give the full path to the java executable, for example:
<string>-vm</string><string>/Library/Java/JavaVirtualMachines/jdk-13.0.2.jdk/Contents/Home/bin/java</string>
Then my eclipse started from the (already) mounted Eclipse image without complaining

I had the same issue myself a while back. In your Eclipsepedia it provided an example of what the eclipse.ini file looks like when your trying to specify a JVM. So just change the eclipse.ini file and then make sure that you have all of the correct documents in that path to match the example.

Related

Not able to run Eclipse on macOS Big Sur

I am not able to run eclipse on macOS Big Sur developers beta I am getting an error stating "Failed to create the java virtual machine". Is there any way to solve the error
The java version I am running:
I have the same issue. I solve it by opening /Applications/Eclipse.app/Contents/Info.plist and adding:
<string>-vm</string><string>/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/bin/java</string>
inside
<key>Eclipse</key>
<array>
ADD HERE!
</array>
Of course the "/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/bin/java" value must be replaced with the actual path based on the JDK version you are using.
TL;DR
Use this to export JAVA_HOME variable:
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home
Long Version
This answer is wrt to BigSur v11.0.1 Beta. What I explored is if you have configured your .bash_profile JAVA_HOME export something like this
export JAVA_HOME=$(/usr/libexec/java_home)
Then it case it was trying to importing this, for some reason
/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
rather than
/Library/Java/JavaVirtualMachines/**/Contents/Home
For the quick fix, I configured my JAVA_HOME like this
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home
If you are switching between multiple JVMs at once then you may find this .bashrc/.zshrc configuration handy
export JAVA_8_HOME="jdk1.8.0_231.jdk"
export JAVA_11_HOME="openjdk-11.0.2.jdk"
export JAVA_13_HOME="jdk-13.0.1.jdk"
alias java8='export JAVA_HOME="/Library/Java/JavaVirtualMachines/$JAVA_8_HOME/Contents/Home"'
alias java11='export JAVA_HOME="/Library/Java/JavaVirtualMachines/$JAVA_11_HOME/Contents/Home"'
alias java13='export JAVA_HOME="/Library/Java/JavaVirtualMachines/$JAVA_13_HOME/Contents/Home"'
# default to Java 8
java8
Edit the Info.plist to set the -vm value.
Install the latest Eclipse version, I am using version 2020-06
Right-click on Eclipse.app
Show Package Contents
Open Info.plist with a text editor
Add -vm/Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home/bin/java under the under the key Eclipse. Note - edit the path to Java depending on what version you have. You can see the list by running /usr/libexec/java_home -V
To fix this issue I deleted the openJDK VM and reinstalled it
Delete the openJDK folder from
/Library/Java/JavaVirtualMachines
Reinstall openJDK from here
Open applications and right-click spring suite > Show Package Contents
Edit file Contents/info.plist. Add this
<string>-vm</string><string>/Library/Java/JavaVirtualMachines/adoptopenjdk-14.jdk/Contents/Home/bin/java</string>
This should be inside the array tag inside eclipse key
I solved this by using Homebrew
brew cask install eclipse-java
Same thing happened to me turns out when I ran echo $JAVA_HOME the directory has been replaced,
Doing a brand new export to the java home file seemed to do the trick,
I used
export JAVA_HOME=/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/
Seemed to do the trick, note that your directory might be different I suggest tracing to your correct directory by using "/" then tab to trace the directories.
In my case I'm using a old version IDE and it's dead, already add the JAVA_HOME variable, ini and list of eclipse and not working, also noticed virtualbox is dead also can start any VM.
-vm/Library/Java/JavaVirtualMachines/jdk1.8.0_251.jdk/Contents/Home/bin/java
Confirmed, adding below to Infolplist worked. I have Oracle jdk 8 and updated the value below.
-vm/Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home/bin/java
I tried all solutions posted under this question; but none of them worked for me. Finally, I installed the latest version of Eclipse 2020-09 (4.17.0) to make it work.
I upgraded to Big Sur a few days ago and also encountered this problem when I finally ran Eclipse this morning.
The latest Eclipse 2020-12 release includes its own JRE (!), thus I no longer experience "Failed to create the java virtual machine". I've left my Java versions unchanged for now as I only use Eclipse to create Tomcat webapps and do not run standalone Java.
$ /usr/libexec/java_home
/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
$ /usr/libexec/java_home -V
Matching Java Virtual Machines (3):
1.8.121.13 (x86_64) "Oracle Corporation" - "Java" /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
1.8.0_121 (x86_64) "Oracle Corporation" - "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home
1.7.0_60 (x86_64) "Oracle Corporation" - "Java SE 7" /Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home
/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
In addition to all steps recommended above I had to create the following symlink:
cd /Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/lib
sudo ln -s ../jre/lib/server/libjvm.dylib libserver.dylib
The version of the Eclipse I use is 4.4.1. (because tested to work well with WebObjects)
I had to install the latest version of Eclipse to make it work since that uses Java 11. This happened after I updated to Big Sur.
Step 1 : Uninstall jdk 8
Step 2 : Install openjdk14 by brew
Step 3 : install eclipse 2020-12 version
I deleted all Eclipse files that were already installed and just simply reinstalled with this --cask eclipse-jee on Home brew. I hope it's helpful for whoever is struggling just like past myself.
I experienced this issue while using Eclipse Mat and JDK Mission Control
On Mac OS v11.6 (Big Sur ) ,the dependency was Java 11 . The following was added in the whatever.app/Contents/Info.plist
<key>Eclipse</key>
<array>
<string>-vm</string
<string>/Users/<yourHomeDir>/.sdkman/candidates/java/11.0.2-open/bin/java</string>
<string>-keyring</string>
<string>~/.eclipse_keyring</string>
</array>
If you are using eclipse 2020-06 sure you will be facing pop-up with empty grey window when debugging.
No chance to use Big Sur with eclipse 2020-06 anymore. I'm using eclipse 2021-03 IDE developer and it's working fine. But STS not support anymore you have to manual change to old JAVA 1.8 for your project.
Right click project and properties
Configure Java Build Path
Libraries Tab -> Edit -> change to Java 1.8
Order and Export Tab -> move JRE System Library on top of Project and External Dependencies.
Apart from the suggestions given, I also had to do an additional step of removing eclipse app from quarantine :
1)Open up a shell
2)Cd yourself into the eclipse directory.
3)Check the attributes of the directory Eclipse.app/ $ xattr Eclipse.app/ com.apple.quarantine
4)Remove the ‘com.apple.quarantine’ attribute. $ xattr -d com.apple.quarantine Eclipse.app/
After completing this along with steps to edit the Info.plist, I was able to open Eclipse
Setting-security&privacy->Full Disk Access, add eclipse or Spring Tool Suite app.
brew install openjdk
add to /Applications/ApacheDirectoryStudio.app/Contents/Info.plist <dict>
<array>:
<string>-vm</string>
<string>/usr/local/opt/java/libexec/openjdk.jdk/Contents/Home/bin/java</string>

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 .

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

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.

eclipse.exe stop working in windows 10

I recently update my Windows7 to Windows10 by free Microsoft reservation and upgradation.
Before upgradation eclipse started normally and didn't has any problem but since I upgrade my windows I can't run it , when I try to open it I get the "eclipse.exe stop working" error.
I too got the same error. I tried following steps.
Reinstalled JDK (JDK 1.8 update 60 - 64 bit)
Installed fresh copy of eclipse (latest version - Eclipse 4.5 Mars)
Installed 32 bit version of JDK
None of these worked for me.
Finally I opened the eclipse by right clicking and Run As Administrator option - found this option in another forum. This worked for me.
Try to open eclipse via the commandline. (Open cmd, go to the eclipse folder, run eclipse.exe). You might get more information about the crash there and we can try to resolve the error.
I'm also facing this issue between Windows 10 and Eclipse Luna 4.4.2.
It was working just fine for several weeks and one day it begins.
I try to upgrade my JDK to 1.8.66 without success; try older JDK 1.7.80 and same problem.
I was able to run eclipse after adding JAVA_HOME environment variable and launching eclipse ide as administrator, as #Shyamkumar suggested above.
Another really ANNOYING thing is how the moderators of StackOverflow evaluate some questions posted here. Please Do Not downgrade questions if the answers may help other people. It is not about you, but the others !
In eclipse.ini file at VM, if it looks like:
-vm C:/Users/Nitin/.p2/pool/plugins/org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_14.0.2.v20200815-0932/jre/bin
try replacing it with the following:
-vm C:\Program Files\Java\jdk-15.0.1\bin\javaw.exe
Note: The folder depends on the JDK version you have installed.
Try this. It worked for me.

Mac OS X Java Update: where is my jdk?

I've installed on my iMac (Mac OS X 10.6.6) the Java update which contains the version 1.6.0_24 of the jdk. I think this update has changed the directory structure of the jdk, so now I'm not able to configure it on eclipse.
Before the update my eclipse were linked to this path: /System/Library/Frameworks/JavaVM.Framework/Versions/Current/Home which actually seems wrong.
Now I'm not able to link my eclipse to the jdk. Maybe this is the right path: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home, but 1.6.0.jdk isn't a directory, so I'm not able to choose it in eclipse.
Has anyone experienced this problem? How can I solve it?
For me following jdk link is working fine on Eclipse:
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
It was my fault. I had also a jdk 1.5 manually installed and the update moved it away.
Probably I made a mistake restoring my jdk-1.5 to its correct location.
To solve my issue I just had to restore the symbolic links /System/Library/Frameworks/JavaVM.Framework/Versions/CurrentJDK, which has to point to /System/Library/Frameworks/JavaVM.Framework/Version.
the follow directory works:
/Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home
without "System"
Execute /usr/libexec/java_home on the terminal shell.
It will display a list of all your installed JDKs
On MacOSX 10.10, jdk 1.8 with IntelliJ, I use:
/Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/
I was missing CurrentJDK folder as well, but I'm running Mac OS El Capitan.
In El Capitan it's not possible to modify the folder /System/Library/Frameworks/JavaVM.framework/Versions, since it is under the /System folder and SIP is protecting it (you can disable SIP, but I do not recommend), a custom CurrentJDK soft link is not allowed.
I got some legacy software which was searching for CurrentJDK, and there was no way to update the path. To solve it I had to install Java for OS X 2015-001 provided by apple (it's Java 1.6), which fixed the Versions subfolder structure by pointing to the old Java 1.6. Not the best, but it fixed my error!