• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jar executable won't work when copied into desktop

 
Tariq Ahsan
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a GUI application called 'GUI' which connects to a oracle database. I copied the classes12.jar for the JDBC connection from c:\oracle\ora92\jdbc\lib into my local directory c:\myfolder\java where I have my GUI application. I have the manifest file, 'manifest.txt' to have -

Main-Class: GUI<cr>
Class-Path: classes12.jar<cr>

From the DOS prompt I am doing -

C:\MyFolder\Java> jar mcf GUI.jar GUI*.class

Now double-clicking on GUI.jar executable from C:\MyFolder\Java works fine and gets connected to the database without any problem.

But when I copy the same GUI.jar into my desktop window and do the same I am only getting the first opening screen from my GUI but hangs when trying to connect to the database.

Also, if I copy the jar executable into another directory and try it run it from the command prompt I get the error as shown below -

C:\>java -jar GUI.jar
Error :
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver

I have tried to modify the Manifest.txt file several ways giving full path to the classes12.jar in the Class-Path and also directory path to the entry point in Main-Class. Nothing seems to work. One of the such way is like -

Main-Class: MyFolder.Java.GUI<cr>
Class-Path: C:/MyFolder/Java/classes12.jar

The contents in the jar is as follows -

C:\MyFolder\Java>jar tf GUI.jar
META-INF/
META-INF/MANIFEST.MF
GUI$1.class
GUI$ButtonHandler.class
GUI$CheckBoxListener.class
GUI$ComboBoxListener.class
GUI$MenuItemHandler.class
GUI$RadioListener.class
GUI$WindowEventHandler.class
GUI.class

Any idea what am I doing wrong?
 
Shailesh Chandra
Ranch Hand
Posts: 1082
Java Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are using classes12.jar in you application then it should be in your classpath

add the location of classes12.jar in your classpath

It should solve your problem

Shailesh
 
Steven Bell
Ranch Hand
Posts: 1071
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please don't double post.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please continue discussion in original thread
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic