[jboss-user] [JNDI and Naming] - Re: dependent class can't be found when invoke by java -classpath xxx -jar jarfile, but can be found by java -classpath xx class

Wolf-Dieter Fink do-not-reply at jboss.com
Thu Jun 21 06:34:54 EDT 2012


Wolf-Dieter Fink [https://community.jboss.org/people/wdfink] created the discussion

"Re: dependent class can't be found when invoke by java -classpath xxx -jar jarfile, but can be found by java -classpath xx class"

To view the discussion, visit: https://community.jboss.org/message/743322#743322

--------------------------------------------------------------
This is not really a JBoss queestion, you should read the Java documentation.
here a snippet from the "java" command
> *-jar* Execute a program encapsulated in a JAR file. The first argument is the name of a JAR file instead of a startup class name. In order for this option to work, the manifest of the JAR file must contain a line of the form *Main-Class: +classname+*. Here, +classname+ identifies the class having the public static void main(String[] args) method that serves as your application's starting point. See the  http://docs.oracle.com/javase/1.4.2/docs/tooldocs/windows/jar.html Jar tool reference page and the Jar trail of the  http://java.sun.com/docs/books/tutorial/jar Java Tutorial for information about working with Jar files and Jar-file manifests.  *When you use this option, the JAR file is the source of all user classes, and other user class path settings are ignored.  
> *
> 
> 

If you want to use -jar add the dependencies to other jars to manifest and copy all jars in the same folder.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/743322#743322]

Start a new discussion in JNDI and Naming at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2083]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120621/14415898/attachment.html 


More information about the jboss-user mailing list