Java 9 Eclipse 4.7 Portable export error "resource not found", "Could not find main method from given launch configuration."

Viewed 1315

A few days ago I installed Oracle JDK 9. I tried to use Eclipse, but it didn't work. I looked around and found this link. So I updated my Eclipse with the link showed after

To try out Java 9 support in Eclipse, you can follow any of these:

by clicking on Help -> Install New Software... and then inserting the link. This went fine and I already could started coding and I could also run it.

But I didn't manage to do the second step, because dragging the Install button did nothing.

(Second step:)

Update your Eclipse 4.7 build for committers using Eclipse Marketplace entry (currently, needs some additional steps):

Then I realised that I didn't have the Eclipse Marketplace Client, so I installed it and then it went fine.

But here is the problem: When I try to Export it as a runnable jar file I get this error: "JAR creation failed. See details for additional information. No resources selected Jar export finished with problems. See details for additional information. Could not find main method from given launch configuration. "

Error Message in Eclipse

I already tried creating new Launch Configurations, Making a completly new empty project, and creating a new workspace. Nothing did work.

Has anyone an Idea why this doesn't work and what I can do to fix this?

EDIT

My eclipse.ini:

-startup
plugins/org.eclipse.equinox.launcher_1.4.0.v20161219-1356.jar
--launcher.library
  plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.500.v20170921-1704
--launcher.defaultAction
openFile
--launcher.appendVmargs
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vm
C:/Program Files/Java/jdk-9/bin/javaw.exe   
-vmargs
--add-modules=ALL-SYSTEM
-Dosgi.requiredJavaVersion=1.8
-Xms256m
-Xmx1024m
2 Answers

As also confirmed in the comments, the issue is filed as BUG#525711 in Eclipse.

Update:- It has been verified as fixed in M20171115-1700, which primarily means that if one is using nightly or builds released after November 15, 2017 they should be able to create JAR using Eclipse.

=> Though another point to note here shall be that this causes a subsequent BUG#527114 for failure in handling multiple modules while creating the JAR.

I would guess one shall mostly expect these updated in the Eclipse Photon build in future.

Related