java - Jar file doesn't work outside the project folder -


my jar file doesn't work outside project folder, unless put in same directory lib folder. when run jar command line this:

    c:\users\computer>java -jar sg.jar exception in thread "awt-eventqueue-0" java.lang.noclassdeffounderror: org/hiber nate/cfg/annotationconfiguration         @ view.pessoaview.<init>(pessoaview.java:27)         @ view.pessoaview$7.run(pessoaview.java:291)         @ java.awt.event.invocationevent.dispatch(unknown source)         @ java.awt.eventqueue.dispatcheventimpl(unknown source)         @ java.awt.eventqueue.access$500(unknown source)         @ java.awt.eventqueue$3.run(unknown source)         @ java.awt.eventqueue$3.run(unknown source)         @ java.security.accesscontroller.doprivileged(native method)         @ java.security.protectiondomain$1.dointersectionprivilege(unknown sour ce)         @ java.awt.eventqueue.dispatchevent(unknown source)         @ java.awt.eventdispatchthread.pumponeeventforfilters(unknown source)         @ java.awt.eventdispatchthread.pumpeventsforfilter(unknown source)         @ java.awt.eventdispatchthread.pumpeventsforhierarchy(unknown source)         @ java.awt.eventdispatchthread.pumpevents(unknown source)         @ java.awt.eventdispatchthread.pumpevents(unknown source)         @ java.awt.eventdispatchthread.run(unknown source) caused by: java.lang.classnotfoundexception: org.hibernate.cfg.annotationconfigu ration         @ 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)         ... 16 more 

the same other "windows", cause application has many menu itens. have extracted jar file, check , there's no lib folder there. believe should. jar files needed hibernate , others required in lib folder. can help?thanks.. , here link similar question:

why doesn't jar file run outside netbeans??

your problem jar not includes dependancies requires execution.

your program requires hibernate jars. can compile dependancies current jar using maven.

try : build jar dependancies


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -