java - ClassNotFoundException problems with manifest in created JAR -


i'm trying create jar file sources, when run class not found exception - can't find main class, though defined in manifest.mf file. can spot errors please?

my jar structure:

meta-inf/ meta-inf/manifest.mf main/ main/java/ main/java/threadwatcher.java main/java/watcherobject.java main/resources/ main/resources/watcherobjecttype.java main/resources/tlogger.java main/resources/dataprovider.java main/resources/watcherobjectstatus.java main/resources/settingsprovider.java 

main/java/watcherobject.java contains main method.

my manifest.mf:

manifest-version: 1.0 created-by: 1.6.0_27 (sun microsystems inc.) main-class: main.java.threadwatcher 

when run get:

exception in thread "main" java.lang.noclassdeffounderror: main/java/threadwatcher caused by: java.lang.classnotfoundexception: main.java.threadwatcher     @ java.net.urlclassloader$1.run(unknown source)     @ java.security.accesscontroller.doprivileged(native method)     @ java.net.urlclassloader.findclass(unknown source)     @ java.lang.classloader.loadclass(unknown source)     @ sun.misc.launcher$appclassloader.loadclass(unknown source)     @ java.lang.classloader.loadclass(unknown source) not find main class: main.java.threadwatcher. program exit. 

thanks help!

the problem you're including java source files, rather compiled classfiles. when load class, jvm default looks classfile given name , tries load it. since don't have classfiles, can't load class.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -