I am trying to exort a Java project with Eclipse 3.6.1 to a runnable Jar. This used to work properly but failed today, afer I added some additional Jars to my class path.
The error is
duplicate entry: some/class.class
Interestingly, there is a duplicate entry for almost any class in my buildpath. Even though I did not change anything. The Jars I added do not contain duplicate classes.
Question: Is this some kind of Eclipse bug? Am I ovrlooking something obvious? Does anybody have an idea what could cause this error?
Cheers
To export your project, right-click it and select Export. Select Java > Runnable JAR file as the export destination and click Next. On the next page, specify the name and path of the JAR file to create and select the Launch configuration that includes the project name and the name of the test class.
Drag the jar file into the project folder in Eclipse. The jar file will now show up in the project. 2. Right click on the project after you have added the jar and select Properties.
Either from the context menu or from the menu bar's File menu, select Export. Expand the Java node and select JAR file. Click Next. In the JAR File Specification page, select the resources that you want to export in the Select the resources to export field.
You could try modifying the line
<jar destfile="/Volumes/resi/talosBase.jar" filesetmanifest="mergewithoutmain">
in your build file to be
<jar destfile="/Volumes/resi/talosBase.jar" filesetmanifest="mergewithoutmain" duplicate="preserve">
This will cause ant to preserve the first entry of any duplicate and ignore the rest. The default behavious is "add" so you can end up with multiple files of the same fully qualified name. The other valid entry for this paramter is "fail" but I don't think that will help you here.
OLD-Answer
Delete your last created runnable jar either manually or alter the generated ant script to do so before creating a new one
Cleaning the project should help. It is not eclipse bug, but rather jar maker's one. Apparantly, it takes the classes and see that such classes already exist and can't understand that it should replace them instead of adding.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With