File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Program will not run on another machine. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Program will not run on another machine." Watch "Program will not run on another machine." New topic

Program will not run on another machine.

Tim Bryant

Joined: Jul 30, 2011
Posts: 5
I successfully completed my first java project by using netbeans. The program runs perfectly on the machine which I built it on. However when i copy the executable Jar file to another machine and try to run it I get class not found exceptions.

For example : java.lang.ClassNotFound Exception: net.sourceforge.jtds.jdbc.Driver

Is everything the program needs to run not packaged into the jar when it's created?

Thanks for any help you can give.
Paul Clapham

Joined: Oct 14, 2005
Posts: 19973

No. You'll want to modify the process of creating your executable jar so that the jar's manifest contains a reference to your AS/400 JDBC driver jar. You'll also want to install that JDBC driver jar in the right place (whatever the manifest says) before running your executable jar.
Vijay Tidake
Ranch Hand

Joined: Nov 04, 2008
Posts: 146

When you prepare the jar using netbeans it require a lib folder in the classpath for the jar that you are using in your project.
for eg-the folder must be having eg.jar and lib folder in same folder.

Hope this helps

The important thing is not to stop questioning.Curiosity has its own reason for existing.
I agree. Here's the link:
subject: Program will not run on another machine.
It's not a secret anymore!