• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem about running jar file from netbean dist directory

 
david arnold
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a swing project built with netbean 6.5. I can run the project using IDE, but when I tried to run it in dist directory using command as Readme told


I got exception. In the dist directory, I have

\lib
CardScan.jar


And the MENIFEST.MF in the jar has the contents as follows:

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.7.1
Created-By: 1.5.0_10-b03 (Sun Microsystems Inc.)
Main-Class: com.cardscan.mainClass
Class-Path: lib/ws-client-jaxws.jar lib/swing-layout-1.0.3.jar lib/
jaxws-api.jar lib/jaxws-rt.jar lib/log4j-1.2.15.jar
X-COMMENT: Main-Class will be added automatically by build


The exception is:

Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
..........................
..........................
at javax.xml.ws.Service<init>
at com.ws.client.jaxws.ManagerService<init>


Well, seems the class "ManagerService" is not found, but it is in the "ws-client-jaxws.jar" under the lib directory. And this jar does not have classpath in its MENIFEST.MF file, so i do not need add this classpath to CardScan jar menifest file.

So what is wrong with it? I am stuck here.

Thanks for the help!
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, the class javax/xml/bind/JAXBException isn't found, just like the error message says.

What version of Java are you trying to run it with? < 1.6?
 
david arnold
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oh, i see. Thank you David. I add jaxb-api.jar to the lib and new noclassfound for XMLStreamException. I do not know why it works if I run it from netbean? I am using 1.5.0, as shown in menifest.mf, that is what the project use in netbean and the version shown if I use command "java -version". Confused..

Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic