• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Use jar file to run console based program

 
robin singal
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I run a console based program which contains two files , of which one contains the main. I want to run that program using jar file.
Problem encountered:
I am using javax.comm package in the program.
When i run jar file using : java -jar <filename>.jar
It gives the following exception:
Exception in thread "main" java.lang.NoClassDefFoundError: javax/comm/CommPortIdentifier

at ConnectModem.ModemProcess(ConnectModem.java:22)
at ConnectModem.main(ConnectModem.java:18)

My Manifest file is:

Manifest-Version: 1.0
Class-Path: comm
Main-Class: ConnectModem

How can i run the jar file???

Thanks
 
Campbell Ritchie
Sheriff
Pie
Posts: 49796
69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You will have to add that other jar to your classpath. Somebody else asked the same thing this morning, I think it was here. Read that thread, which will probably answer your questions.
 
robin singal
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks
I did solved my problem.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic