Results 1 to 6 of 6
Thread: Launching a jar file
- 01-25-2011, 11:36 AM #1
Member
- Join Date
- Jan 2011
- Posts
- 3
- Rep Power
- 0
Launching a jar file
Hello, i have problms with launching a jar file.When i try to launch it using java -jar mmeditor.jar it gives me erorr
c:\SWD\MMEditor>java -jar MMEditor.jar
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/lo
gging/LogFactory
at cz.cvut.fjfi.hofman.mmm.model.database.DatabaseMod el.<clinit>(Databas
eModel.java:20)
at cz.cvut.fjfi.hofman.mmm.MappingCreator.<init>(Mapp ingCreator.java:38)
....
missing library can be found here:
Commons Logging - Overview
jar file can be found here:
METAmorphoses: DB to RDF transformation - Browse /MM Mapping Editor/1.0 at SourceForge.net
How can i include missing library to the classpath and launch a jar file?
- 01-25-2011, 11:52 AM #2
Hi, you can use embedded help in Java.
java -help
-cp <class search path of directories and zip/jar files>
-classpath <class search path of directories and zip/jar files>
A : separated list of directories, JAR archives,
and ZIP archives to search for class files.Skype: petrarsentev
http://TrackStudio.com
- 01-25-2011, 01:47 PM #3
Member
- Join Date
- Jan 2011
- Posts
- 3
- Rep Power
- 0
I have read somewhere that classpath is ignored in java while runing jar files.
- 01-25-2011, 02:16 PM #4
Member
- Join Date
- Jan 2011
- Posts
- 3
- Rep Power
- 0
i have mmeditor.jar file in
C:\SWD\MMEditor
and needed library's at c:\swd\MMEditor\lib\
so i try to do so:
c:\SWD\MMEditor>java -cp c:\swd\MMEditor\lib\ -jar MMEditor.jar
c:\SWD\MMEditor>java -cp c:\swd\MMEditor\lib\commons-logging-1.1.1.jar -jar MEditor.jar
and still i get error
c:\SWD\MMEditor>java -cp c:\swd\MMEditor\lib\ -jar MMEditor.jar
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/lo
gging/LogFactory
at cz.cvut.fjfi.hofman.mmm.model.database.DatabaseMod el.<clinit>
.......
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
.....
- 01-25-2011, 02:52 PM #5
Well, I unpack the MMEditor.jar. It has manifest file.
For launcher Jar you need all library, which pointed here.Manifest-Version: 1.0
Ant-Version: Apache Ant 1.6.5
Created-By: 1.5.0_06-b05 (Sun Microsystems Inc.)
Main-Class: cz.cvut.fjfi.hofman.mmm.MappingCreator
Class-Path: antlr-2.7.5.jar postgresql-8.1-407.jdbc3.jar jconn3.jar my
sql-connector-java-3.1.11-bin.jar antlr-2.7.5.jar jena.jar json.jar s
tax-api-1.0.jar xercesImpl.jar wstx-asl-2.8.jar icu4j_3_4.jar concurr
ent.jar xml-apis.jar arq.jar iri.jar postgresql-8.1-407.jdbc3.jar jco
nn3.jar jena.jar jenatest.jar stax-api-1.0.jar dom4j-1.6.1.jar xerces
Impl.jar stax-1.1.1-dev.jar mysql-connector-java-3.1.11-bin.jar commo
ns-logging.jar icu4j_3_4.jar concurrent.jar log4j-1.2.12.jar xml-apis
.jar arq.jar jakarta-oro-2.0.8.jar junit.jar
for example
lib/commons-logging.jar
lib/MMEditor.jar
lib/..
java -jar MMeditor.jar
It is all.Skype: petrarsentev
http://TrackStudio.com
- 01-25-2011, 03:11 PM #6
Moderator
- Join Date
- Apr 2009
- Posts
- 10,484
- Rep Power
- 16
Similar Threads
-
Launching an exe
By kanupriya in forum New To JavaReplies: 19Last Post: 01-19-2011, 10:24 AM -
launching applet via jsp
By rafzio4 in forum New To JavaReplies: 2Last Post: 09-24-2010, 08:35 AM -
launching .rm file outside java
By nonboyx in forum Threads and SynchronizationReplies: 2Last Post: 09-28-2009, 07:40 PM -
Launching applications without an IDE
By this_is_phil in forum New To JavaReplies: 6Last Post: 05-24-2008, 07:54 AM -
Launching Applet from a JSP page
By Java Tip in forum Java TipReplies: 0Last Post: 01-31-2008, 12:53 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks