File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Java in General
Accessing class in jar
Joined: Oct 16, 2001
Jan 08, 2008 13:48:00
I have jar file(app.jar) with an application that references a class in another jar file(support.jar). Both jar files are in appfolder. In order to run it from the command line, I run:
-classpath c:\appfolder\support.jar -jar app.jar
I keep getting
referencing the class in support.jar. What am I missing here?
Sun Certified Java 2 Programmer
Joined: Sep 29, 2002
Jan 08, 2008 16:00:00
If you use the -jar option, java.exe will silently ignore the classpath and only look inside app.jar. One solution is to add support.jar to the manifest Class-Path.
SCJP 1.4, SCWCD 1.3, SCBCD 1.3
Jesper de Jong
Joined: Aug 16, 2005
Jan 09, 2008 01:36:00
For the details, see:
The Java Tutorials - Packaging Programs in JAR Files
Java Beginners FAQ
JavaRanch SCJP FAQ
The Java Tutorial
Java SE 7 API documentation
- My blog about Scala
I agree. Here's the link:
subject: Accessing class in jar
getting an error while executing jar file
JAR + Properties
Modifying existing jar file, how?
Executable jar that contains other jars
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013