Community
Participate
Working Groups
See e.g. https://stackoverflow.com/questions/46475709/java-9-eclipse-4-7-portable-export-error-resource-not-found-could-not-find-m?noredirect=1#comment80185686_46475709 I can reproduce on a simple modular toy project plus a launch configuration that has both the project itself and JRE on the module path.
I think exporting logic lies in jdt ui. @Noopur ?
(In reply to Sarika Sinha from comment #1) > I think exporting logic lies in jdt ui. > @Noopur ? Sorry, I was misled by the relation to launch configurations. Indeed the error is raised from org.eclipse.jdt.internal.ui.jarpackagerfat.FatJarPackageWizardPage.getSelectedElementsWithoutContainedChildren(ILaunchConfiguration, JarPackageData, IRunnableContext, MultiStatus)
Problem occurs, because FatJarPackageWizardPage.getClasspath(ILaunchConfiguration) only inspects entries of kind IRuntimeClasspathEntry.USER_CLASSES, not of kind IRuntimeClasspathEntry.MODULE_PATH. Including MODULE_PATH in the check lets export complete, but then if multiple modules are involved the resulting jar merges them all into the root of the jar and only one module-info.class will survive. Shouldn't modular jars create separate root folders per module? Do we have a bug for that?
(In reply to Stephan Herrmann from comment #3) > Problem occurs, because > FatJarPackageWizardPage.getClasspath(ILaunchConfiguration) only inspects > entries of kind IRuntimeClasspathEntry.USER_CLASSES, not of kind > IRuntimeClasspathEntry.MODULE_PATH. Not sure but some failures in bug 515921 could be related. > Including MODULE_PATH in the check lets export complete, but then if > multiple modules are involved the resulting jar merges them all into the > root of the jar and only one module-info.class will survive. > > Shouldn't modular jars create separate root folders per module? Do we have a > bug for that? There is no bug for this yet. We can check how it is handled for multiple plug-ins currently and do the same for modules in a separate bug.
*** Bug 526037 has been marked as a duplicate of this bug. ***
(In reply to Noopur Gupta from comment #4) > (In reply to Stephan Herrmann from comment #3) > > Problem occurs, because > > FatJarPackageWizardPage.getClasspath(ILaunchConfiguration) only inspects > > entries of kind IRuntimeClasspathEntry.USER_CLASSES, not of kind > > IRuntimeClasspathEntry.MODULE_PATH. > > Not sure but some failures in bug 515921 could be related. > > > Including MODULE_PATH in the check lets export complete, but then if > > multiple modules are involved the resulting jar merges them all into the > > root of the jar and only one module-info.class will survive. > > > > Shouldn't modular jars create separate root folders per module? Do we have a > > bug for that? > > There is no bug for this yet. We can check how it is handled for multiple > plug-ins currently and do the same for modules in a separate bug. Is there any work-around at the moment? I also tried creating a new project with just a main class and a println but i always get this error
(In reply to Andrea Sanguineti from comment #6) > (In reply to Noopur Gupta from comment #4) > > (In reply to Stephan Herrmann from comment #3) > > > Problem occurs, because > > > FatJarPackageWizardPage.getClasspath(ILaunchConfiguration) only inspects > > > entries of kind IRuntimeClasspathEntry.USER_CLASSES, not of kind > > > IRuntimeClasspathEntry.MODULE_PATH. > > > > Not sure but some failures in bug 515921 could be related. > > > > > Including MODULE_PATH in the check lets export complete, but then if > > > multiple modules are involved the resulting jar merges them all into the > > > root of the jar and only one module-info.class will survive. > > > > > > Shouldn't modular jars create separate root folders per module? Do we have a > > > bug for that? > > > > There is no bug for this yet. We can check how it is handled for multiple > > plug-ins currently and do the same for modules in a separate bug. > > Is there any work-around at the moment? > I also tried creating a new project with just a main class and a println but > i always get this error The easiest workaround at the current moment is to use an older version of the jdk for eclipse. This can be done by going into Window->Preferences->Java->Install JREs and adding the older jdk folder. I've rolled back to jdk8 and the eclipse's export jar works fine, in most cases. If you really need to use Java9, then you're best bet is to manually create the jar using javac or using another build system like Gradle.
(In reply to Mason Chou from comment #7) > (In reply to Andrea Sanguineti from comment #6) > > (In reply to Noopur Gupta from comment #4) > > > (In reply to Stephan Herrmann from comment #3) > > > > Problem occurs, because > > > > FatJarPackageWizardPage.getClasspath(ILaunchConfiguration) only inspects > > > > entries of kind IRuntimeClasspathEntry.USER_CLASSES, not of kind > > > > IRuntimeClasspathEntry.MODULE_PATH. > > > > > > Not sure but some failures in bug 515921 could be related. > > > > > > > Including MODULE_PATH in the check lets export complete, but then if > > > > multiple modules are involved the resulting jar merges them all into the > > > > root of the jar and only one module-info.class will survive. > > > > > > > > Shouldn't modular jars create separate root folders per module? Do we have a > > > > bug for that? > > > > > > There is no bug for this yet. We can check how it is handled for multiple > > > plug-ins currently and do the same for modules in a separate bug. > > > > Is there any work-around at the moment? > > I also tried creating a new project with just a main class and a println but > > i always get this error > > The easiest workaround at the current moment is to use an older version of > the jdk for eclipse. This can be done by going into > Window->Preferences->Java->Install JREs and adding the older jdk folder. > > I've rolled back to jdk8 and the eclipse's export jar works fine, in most > cases. > > If you really need to use Java9, then you're best bet is to manually create > the jar using javac or using another build system like Gradle. Ok thanks
*** Bug 526340 has been marked as a duplicate of this bug. ***
When will the release date of this patch? I need it so much because the java 9 runtime cannot run my java program.
(In reply to Stephan Herrmann from comment #3) > Problem occurs, because > FatJarPackageWizardPage.getClasspath(ILaunchConfiguration) only inspects > entries of kind IRuntimeClasspathEntry.USER_CLASSES, not of kind > IRuntimeClasspathEntry.MODULE_PATH. > > Including MODULE_PATH in the check lets export complete, but then if > multiple modules are involved the resulting jar merges them all into the > root of the jar and only one module-info.class will survive. > > Shouldn't modular jars create separate root folders per module? Do we have a > bug for that? Are multiple modules allowed in a single jar file? https://docs.oracle.com/javase/9/docs/specs/jar/jar.html talks about modular jar files which have module-info.class, in the top-level directory (or root) directory. But does not mention anything about including other modules in the modular jar. There is also no way to specify the module path for the included modules in the Manifest.
New Gerrit change created: https://git.eclipse.org/r/111199
The new gerrit change along with the the changes for bug 515921 fix the issue of creating modular jar file using java9. This change also supports creation of a Jar file which includes other modular jars.
(In reply to Kalyan Prasad Tatavarthi from comment #13) > The new gerrit change along with the the changes for bug 515921 fix the > issue of creating modular jar file using java9. > > This change also supports creation of a Jar file which includes other > modular jars. The New gerrit change along with the the changes for bug 515921 fix the issue of creating modular jar file using java9. This change also supports creation of a Jar file which includes other modular jars only if they are packaged. This operation fails if the required libraries are exported due to the same issue of handling multiple modules.
Gerrit change https://git.eclipse.org/r/111199 was merged to [master]. Commit: http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=d0c3cc36f648a39a45a7d7a8a4c981a21293ddaa
New Gerrit change created: https://git.eclipse.org/r/111210
(In reply to Eclipse Genie from comment #16) > New Gerrit change created: https://git.eclipse.org/r/111210 Kalyan, please verify the fix in the next I-build, after which it can be released in the R4_7_maintenance branch.
(In reply to Noopur Gupta from comment #17) > (In reply to Eclipse Genie from comment #16) > > New Gerrit change created: https://git.eclipse.org/r/111210 > > Kalyan, please verify the fix in the next I-build, after which it can be > released in the R4_7_maintenance branch. Verified the fix in the I-build I20171108-2000.
Gerrit change https://git.eclipse.org/r/111210 was merged to [R4_7_maintenance]. Commit: http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=fa928215e5fcf8ae06b4b5a5bfa82f5efa2f7be2
Created follow-up bugs: bug 527114 and bug 527113.
Verified as fixed in M20171115-1700.
If this bug is supposed to be fixed in Eclipse Java EE IDE for Web Developers. Version: Oxygen.3a Release (4.7.3a) Build id: 20180405-1200 It is not! The operation yields a jar file of 1KB and only : META_INF dir with only a MANIFEST.MF file consisting of: Manifest-Version: 1.0 Class-Path: .
(In reply to Clifton Liles from comment #22) > If this bug is supposed to be fixed in > Eclipse Java EE IDE for Web Developers. > Version: Oxygen.3a Release (4.7.3a) > Build id: 20180405-1200 > > It is not! > The operation yields a jar file of 1KB and only : > META_INF dir with only a MANIFEST.MF file consisting of: > Manifest-Version: 1.0 > Class-Path: . This bug fixes the issue of: 1) Export > Java > JAR file 2) Export > Java > Runnable JAR file I have tested and checked if this is fixed in Eclipse Java EE IDE for Web Developers. Version: Oxygen.3a Release (4.7.3a) Build id: 20180405-1200 and it is fixed. Is this the same scenario you are using and you are not able to create a jar or a runnable jar file? if so, please provide a sample project to reproduce this issue. Or are you using : Export > Java EE > App Client JAR file? If this is the case, that is a different bug.
I am using : 1) Export > Java > JAR file 2) Export > Java > Runnable JAR file Both fail. This seams to a general problem. I have tried to do this on serval project and all give the same result, fail. Note: I have been getting a lot of "Eclipse had an error. Sent it?" I have sent them all. Could it be that my copy of eclipse is corrupted? I will try and get togeather a sample project for you. Cliff
(In reply to Kalyan Prasad Tatavarthi from comment #23) > (In reply to Clifton Liles from comment #22) > > If this bug is supposed to be fixed in > > Eclipse Java EE IDE for Web Developers. > > Version: Oxygen.3a Release (4.7.3a) > > Build id: 20180405-1200 > > > > It is not! > > The operation yields a jar file of 1KB and only : > > META_INF dir with only a MANIFEST.MF file consisting of: > > Manifest-Version: 1.0 > > Class-Path: . > > This bug fixes the issue of: > 1) Export > Java > JAR file > 2) Export > Java > Runnable JAR file > > I have tested and checked if this is fixed in > Eclipse Java EE IDE for Web Developers. > > Version: Oxygen.3a Release (4.7.3a) > Build id: 20180405-1200 > > and it is fixed. > > Is this the same scenario you are using and you are not able to create a jar > or a runnable jar file? > if so, please provide a sample project to reproduce this issue. > > Or are you using : Export > Java EE > App Client JAR file? > > If this is the case, that is a different bug. Ups, I entered a comment instead of replying. Please see comments 25 and 25. Please delete one of then if you have the power.
OK, I don't know what to say. I made a test project and it worked! I went back to one that failed and it worked. When I working on making the jar file, eclipse was restarted a few times, I think there was a computer shutdown and restart also. I just switched workspaces and the other failed jar and it also worked. Note: I had also tried building a regular jar(not executable) file, with a manifest file added. It also failed, with an empty manifest at the head and my manifest in the body of the jar. If there is anything you would like, Please let me know. Unfortunately the bad jars have been overwritten or deleted. Cliff
(In reply to Clifton Liles from comment #27) > OK, I don't know what to say. I made a test project and it worked! Any chance that any of the Eclipse restarts also involved installation of some updates? Other than that I don't see a chance to find out what was going on and your bug just escaped into the wild :)
(In reply to Stephan Herrmann from comment #28) > (In reply to Clifton Liles from comment #27) > > OK, I don't know what to say. I made a test project and it worked! > > Any chance that any of the Eclipse restarts also involved installation of > some updates? Other than that I don't see a chance to find out what was > going on and your bug just escaped into the wild :) Possible, I guess. I did not notice any. I did find a couple of the bad jar files. If you what to have a look at them. I'll send them to you. Maybe Eclipse is self healing!
Created attachment 278337 [details] OK and Error export project in ZIP Files First project in YIP file export OK two project eror . Projects is from one system eclipse, creates in this system concurrently.
The same error in configure -- Configuration Details -- Product: Eclipse IDE 4.11.0.20190314-1200 (org.eclipse.epp.package.jee.product)Installed Features: org.eclipse.jdt 3.17.0.v20190307-0500 Versioning Plugin: org.eclipse.platform 4.11.0.v20190307-0500