Tuesday, 15 February 2011

eclipse - How to set Class-Path in Java manifest.txt -



eclipse - How to set Class-Path in Java manifest.txt -

my project construction below

testproject | |---- src | | | |---- bundle | | | |---- main.java | |---- externalibs | |---- lib.jar

the manifest.txt below:

manifest-version: 1.0 created-by: 1.7.0_06 (oracle corporation) main-class: package.main class-path: ../externalibs/lib.jar ./externalibs/lib.jar /externalibs/lib.jar externalibs/lib.jar lib.jar (however i've tried these class paths lib.jar, none of them works)

exporting project eclipse, then, when executing command: java -jar main.jar, exception beingness unable find external lib.jar occurs:

exception in thread "main" java.lang.noclassdeffounderror: org/example/someclassinlib

the output jar construction below:

testproject.jar | |---- externalibs | | | |---- lib.jar | |---- pasckage | | | |---- main.java / main.class / , on... | |---- meta-inf | |---- manifest.mf

what problem manifest.txt ?

thanks help.

in eclipse when export, there alternative export runnable jar file. can utilize library handling radio buttons in wizard take how dependencies handled. first 2 options, dependencies added jar. 3rd alternative creats output folder , places dependency jars in accessible location jar.

java eclipse

No comments:

Post a Comment