• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

eclipse - error with exporting jar

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I wrote a simple Tomcat project(sysdeo plugin v2.2.1) called 'FirstProj' in eclipse 3.0 M4. It has just a single servlet called Test.java in the default package. I tried to export the proj into a jar file and I get,

Jar creation failed
Problem writing /FirstProj/WEB-INF/classes/Test.class to jar: Duplicate entry: Test.class

Whats the problem and is there workaround?
 
Ranch Hand
Posts: 539
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just a guess, but it sounds like there are two files 'Test.class' on your ClassPath that will go into the same directory. Try renaming the class and see if that helps. Otherwise...no idea!



--Tim
 
siva raju
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I made some progress(actually, I found another way not to do things). The source dir for my java files is /WEB-INF/src.
The export tool seems to be copying files and classes to the root i.e. / in the output jar file.
If I move the src from /WEB-INF to /src, the export error does not occur but the .class files generated in /WEB-INF/classes are not exported. Instead all the class and java files are in the root, / of the jar.

Am I missing any export settings. I have the 'build automatically' option set and I even tried toggling it.

Someone please help me quick or else my comp will have my foot sticking from its gut.
 
Sheriff
Posts: 3063
12
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm using WebSphere Application Developer 5.1, but it should be about the same thing. Using wizards, I created a Dynamic Web Project first, then created a Servlet inside it. It put MyServlet.java into a JavaSource directory under the project root, and automatically compiled it to WebContent/WEB-INF/classes. I could then export with no problem, although I'm exporting a war file, not a jar file.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic