Error when open eclipse - MAC - eclipse

I have installed eclipse on my iMac and when I try to open it, it gives me this error:
Failed to find a Main Class in
"/Applications/Eclipse.app/Contents/MacOS//../Eclipse/ plugins/org.eclipse.equinox.launcher_1.5.0.v20180512-1130.jar".
On my MacBook Pro, everything works fine, but I have done nothing different.
I have checked other posts, but most of them refer to a windows OS. There was an answer which said that it can just open when everything is in an English folder and this is true for me!
Thanking you in advance!

I came across this error after installing Eclipse PDT.
Open your terminal and run the version command: java -version.
If your java version is below 1.8, you will have to update your Java
Runtime Environment to at least 1.8.0 by installing an updated JDK
here.
Then re-run the java version command and your version
should be updated.
You should now be able to install and run
Eclipse.

I have the same issue, but on my MacBookPro. I first installed eclipse Photon, which when starting up prompted me to install Java 6, which I did from https://support.apple.com/kb/DL1572?locale=en_US
Then I also installed the latest JRE (jre-8u171-macosx-x64 as of yesterday). When running eclipse again I started getting this error. Then I tried to run from the command line, and got this error:
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/eclipse/equinox/launcher/Main : Unsupported major.minor version 51.0
When googling that, the answers said that the reason for that is that the Oracle installer does not update the symlink in /usr/bin, which seemed to be confirmed by the fact that running java -version returned this:
java -version
java version "1.6.0_65"
The solutions I found for that were not feasible in MacOS starting in version El Capitan, and I am on High Sierra, so I followed the instructions in this post to fix that, and it worked, now I get:
java -version
java version "1.8.0_171"
Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)
After all of this, however, I get the same "Failed to find a Main Class" error on the dialog as reported initially here, and the same "UnsupportedClassVersionError" on the CLI that I had when the system was still on java 6, so now I am still stuck and out of ideas.
EDIT: FIXED IT!!
I kept thinking that the problem was the java version, it was somehow still using java 6 (which I had installed due to the initial prompt).
So I followed the instructions here to remove what I had installed for the alleged java 6 issue. Then I found this post in the eclipse forums, which stated at the end (comment added by Eric Rizzo on Tue, 14 February 2017 21:56) that this is not an Eclipse message, but rather an OS message, and that one should NOT do that as apple messed things up with that patch. And then it goes to explain that one should install java 8 JDK (NOT just the JRE as I had done). Once I removed Java 6 and installed the full java 8 JDK, it ran fine :)

You can edit the eclipse.ini with your vm configuration in the beginning of the file
-vm
/yourJvmPath/jdk-12.0.1.jdk/bin/java
cat /Applications/Eclipse.app/Contents/Eclipse/eclipse.ini
-vm
/Users/SomeUser/jdk-12.0.1.jdk/bin/java
-startup
../Eclipse/plugins/org.eclipse.equinox.launcher_1.5.400.v20190515-0925.jar
--launcher.library
../Eclipse/plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.1.1000.v20190125-2016
PD. It works with ApacheDirectoryStudio for MAC

This one works for me with MAC OS Mojave.
You can download the Java SE Development Kit 8u221 for mac from the below link.
jdk-8u221-macosx-x64.dmg
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Related

Glassfish5 not starting

i have tomcat working fine, the error is not even about the port, which i know how to change, is this some sort of java version compatibility problem?
i'm a student so i don't know much
here's the output
$ asadmin start-domain domain1
Exception in thread "main" java.lang.NullPointerException
at com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.initializeServiceLocator(AbstractModulesRegistryImpl.java:152)
at com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.newServiceLocator(AbstractModulesRegistryImpl.java:144)
at com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.createServiceLocator(AbstractModulesRegistryImpl.java:218)
at com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.createServiceLocator(AbstractModulesRegistryImpl.java:224)
at com.sun.enterprise.module.single.StaticModulesRegistry.createServiceLocator(StaticModulesRegistry.java:88)
at com.sun.enterprise.admin.cli.CLIContainer.getServiceLocator(CLIContainer.java:217)
at com.sun.enterprise.admin.cli.CLIContainer.getLocalCommand(CLIContainer.java:255)
at com.sun.enterprise.admin.cli.CLICommand.getCommand(CLICommand.java:231)
at com.sun.enterprise.admin.cli.AdminMain.executeCommand(AdminMain.java:371)
at com.sun.enterprise.admin.cli.AdminMain.doMain(AdminMain.java:306)
at org.glassfish.admin.cli.AsadminMain.main(AsadminMain.java:57)
the command $ asadmin list-applications says the server is not up
i'm on Mx Linux fully updated
$ java -version
openjdk version "11.0.16" 2022-07-19
OpenJDK Runtime Environment (build 11.0.16+8-post-Debian-1deb11u1)
OpenJDK 64-Bit Server VM (build 11.0.16+8-post-Debian-1deb11u1, mixed mode, sharing)
i haven't done anything yet, i can't find any problem similar to this on google
It was the JDK version
Inside netbeans when i clicked on Start to start the server, it says something about JDK 11, netbeans has a feature that let's you download many open JDK versions, i downloaded a random openJDK8 version and it worked
I don't know how to edit the JDK version manually or from any other IDE though, but my (video) class is using netbeans so for now i'm ok (they didn't teach on video because the video is 2 years old so it's outdated)

Why do I get IllegalStateException: Missing hosting module org.netbeans.libs.javacimpl when upgrade to Netbeans 13?

After I upgraded Netbeans from 12.6 to 13, Netbeans doesn't start. When I start it from the command line, I got the following message:
java.lang.IllegalStateException: Missing hosting module org.netbeans.libs.javacimpl for fragment org.netbeans.modules.nbjavac.impl
at org.netbeans.ModuleManager.refineClassLoader(ModuleManager.java:909)
at org.netbeans.StandardModule.classLoaderUp(StandardModule.java:527)
at org.netbeans.ModuleManager.enable(ModuleManager.java:1330)
at org.netbeans.ModuleManager.enable(ModuleManager.java:1254)
at org.netbeans.core.startup.ModuleList.installNew(ModuleList.java:315)
at org.netbeans.core.startup.ModuleList.trigger(ModuleList.java:251)
at org.netbeans.core.startup.ModuleSystem.restore(ModuleSystem.java:298)
at org.netbeans.core.startup.Main.getModuleSystem(Main.java:156)
at org.netbeans.core.startup.Main.getModuleSystem(Main.java:125)
at org.netbeans.core.startup.Main.start(Main.java:282)
at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:98)
at java.base/java.lang.Thread.run(Thread.java:829)
What's the reason? How can I fix it?
This is caused by old nb-javac (Netbeans Java Compiler) modules installed in an older Netbeans version, which are incompatible with nb-javac, which is now bundled in Netbeans.
It's necessary to remove those old modules. You can find them in the Netbeans user directory. On Linux this is for example in ~/.netbeans or in ~/snap/netbeans/current, if installed as a Snap package. Those nb-javac files are in the modules directory in that directory (e.g. ~/.netbeans/modules) and include nbjavac in the name, e.g. org-netbeans-modules-nbjavac-api.jar. Delete all such files that include nbjavac. Then start Netbeans again, all should work now.
This problem was reported for a development version of Netbeans 13 on the developers' mailing list: https://www.mail-archive.com/dev#netbeans.apache.org/msg09777.html. There are original instructions that helped me to fix this issue. I wasn't using any development build of Netbeans, I just upgraded from the regular version 12.6 to the version 13 of Netbeans. In Netbeans 12.6, I installed the nb-javac plugin, which probably brought these incompatible modules that needed to be removed.
People who are struggling on macOS, same answer as OndroMih but these directories
/Users/<your_user>/Library/Caches/NetBeans
/Users/<your_user>/Library/Application Support/NetBeans

SIGSEGV signal while executing "Eclipse Application" run configuration for my Xtext project

Since my computer has been updated to Mojave (macOS), I get the following error when I am trying to execute an Xtext project (Run As -> Eclipse Application):
A fatal error has been detected by the Java Runtime Environment:
SIGSEGV (0xb) at pc=0x00007fff51115248, pid=10464, tid=775
JRE version: Java(TM) SE Runtime Environment (11.0.1+13) (build 11.0.1+13-LTS)
Java VM: Java HotSpot(TM) 64-Bit Server VM (11.0.1+13-LTS, mixed mode, tiered, compressed oops, g1 gc, bsd-amd64)
Problematic frame:
C [CoreFoundation+0x8248] CFDictionaryGetValue+0xb
No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
An error report file with more information is saved as:
/Applications/Eclipse.app/Contents/MacOS/hs_err_pid10464.log
If you would like to submit a bug report, please visit:
http://bugreport.java.com/bugreport/crash.jsp
The crash happened outside the Java Virtual Machine in native code.
See problematic frame for where to report the bug.
Unfortunately, I do not have so much information to share.
Here my setup:
Mojave, v. 10.14.1
Eclipse DSL Tools, v: 2018-09 (4.9.0), Build id: 20180917-1800
java version "11.0.1" 2018-10-16 LTS, Oracle one
What I have tested:
Running the ulimit -c unimited command
Reinstalling Eclipse
Reinstalling my JDK. I also tested on OpenJDK.
Running on a fresh computer. I don't have the bug on macOs Sierra.
I tested the solution mention here:
how to fix “Failed to write core dump. Core dumps have been disabled” error while running java
Thanks for your help.
#Christian Dietrich: many thanks for the link!
Here the current workaround explained in the link: to add the '-nosplash' in Arguments tab of run configuration.

RoboVM not working on JDK 1.8.0 b112

I'm running Eclipse with RoboVM plugin and I wanted to try IOSDemo sample project described on robovm.org (http://www.robovm.org/docs.html). When creating the project in Eclipse and running it I got following error message.
An internal error occurred during: "Launching IOSDemo".
java.lang.IllegalAccessError: tried to access method java.lang.Object.clone()Ljava/lang/Object; from class soot.toolkits.scalar.LocalSplitter
I found out that it's related to JDK version (I'm running JDK 8.0 ea, build 112). When running on JDK 1.7.0_45 and building the project on cmd line it builds and runs OK.
Is it known problem, is there any workaround or fix? Thanks
This is most probably due to a bug [1] in the recent early access builds of Java8. It looks like the bug was resolved a few days ago but as far as I can see the fix didn't make it into the b113 build. Please use the latest Java7 release or an earlier Java8 EA build until a Java8 build is available with this fix included.
[1] https://bugs.openjdk.java.net/browse/JDK-8026394

MTurk Command Line Tools Error: Bad version number in .class file

I am using the Mechanical Turk command line tools on Windows. When I try to run a command (e.g., getBalance, createQualificationType), I always get the following error:
Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file
Any clues as to what I could look at to fix this would be greatly appreciated!!
I have tried updating my key and secret key to no avail.
Note: I can get help for the commands by using -help, but I cannot run the commands themselves.
This error occurs whether I am running either JRE 1.5.0_06-b05, 1.5.0_22-b03, or 1.7.0_17-b02. The command line tools documentation states, "You must have the Java JRE 1.5.X (JRE 5). The Command Line Tools are not 100% compatible with JRE 6."
Since I am using the version of the command line tools packaged with JRE, I have also uninstalled my JRE. I get the same error.
UnsupportedClassVersionError means that you are trying to use a Java class that was compiled with a newer JDK on an older Java runtime environment. For example, you have a class that was compiled with JDK 7, and you are trying to use it on a Java 6 or older runtime environment.
Java is downwards compatible; newer Java runtime environments can run Java classes compiled with older versions without modifications, but not the other way around.
Check with what version the class you are trying to use was compiled, and use a Java runtime environment with the same version or newer to run the class.
You can check your Java runtime environment and JDK versions with:
java -version
javac -version
Apparently, the CLT installer installs a JRE that is too old to run the tools included in the installer. Seems like a serious bug (certainly annoying).
You can fix by installing and using a more recent JDK.
This post contains instructions on how to do so:
https://forums.aws.amazon.com/message.jspa?messageID=388586#388585