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

匿名 (未验证) 提交于 2019-12-03 01:27:01

问题:

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. "

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 

回答1:

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.



回答2:

I have Build id: 20171218-0600 and the problem is still (or again) in there.

The original bug (525711) has been reopened as (526037):

https://bugs.eclipse.org/bugs/show_bug.cgi?id=526037



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!