• Post Reply Bookmark Topic Watch Topic
  • New Topic

Accessing class in jar  RSS feed

 
Darryl Failla
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:

c:\appfolder>java -classpath c:\appfolder\support.jar -jar app.jar

I keep getting NoClassDefFoundError referencing the class in support.jar. What am I missing here?
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16057
88
Android IntelliJ IDE Java Scala Spring
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!