facebook

App not seeing libraries in JAR file

  1. MyEclipse IDE
  2.  > 
  3. Off Topic
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #233096 Reply

    Paul
    Participant

    I have a non-server app I’m working on that uses the java mail library, and ibatis – both of which I’ve used previously in webapps. In Eclipse I have a lib folder that contains the required Jars (mail.jar, activation.jar, various commons- jars, etc.), and I’ve added those jars via – project properties -> java build path -> project libraries, and it runs fine inside of the ide.

    Exporting to a JAR though I keep getting;

    Exception in thread “main” java.lang.NoClassDefFoundError: javax/mail/Address

    I’ve gone round and round on this, and can’t seem to make it work. I’m sure it’s something minor, and I’d appreciate any help. Thanks.

    #233102 Reply

    Riyad Kalla
    Member

    I don’t think Eclipse’s Export JAR feature actually builds out an executable JAR and honors the build path, you will need to do that with an Ant script. If you rename the JAR to zip and open it, you will likely find your JARs are not in there.

    OR you need to also ship them with the JAR eclispe exported and write a batch file to make sure they are on the classpath when it runs.

    #233110 Reply

    Paul
    Participant

    Thanks – I finally got it working by not using the JAR feature. I had forgotten about Jar files not being included in other Jars. Too much web dev stuff…

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: App not seeing libraries in JAR file

You must be logged in to post in the forum log in