File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Problem with Jar Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Problem with Jar" Watch "Problem with Jar" New topic
Author

Problem with Jar

Victor O'Sullivan
Greenhorn

Joined: Oct 18, 2008
Posts: 7
I finished developing a program in the Eclipse IDE, so I exported it to a Jar file. My computer intially opened up the Jar file using winzip, so i changed the default program to open it with to Java (TM) Platform SE Binary.
Now when I double click on the icon, the timer glass shows for about 1-2 seconds and then thats it, nothing else happens. I can't get my program to open up outside of my IDE.

If anyone could help I would greatly appreciate it.

Thanks.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38481
    
  23
How did you set the entry point in Eclipse?

Have you read the Java Tutorials section?
Amirtharaj Chinnaraj
Ranch Hand

Joined: Sep 28, 2006
Posts: 236
check do you have main class in your jar and if it is ok
add mainfiest to your jar
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10268
    
    8

Originally posted by Victor O'Sullivan:
.. thats it, nothing else happens.


If you run the jar from the command line, you can find out from the exception(s) what is going wrong and fix it accordingly.


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Victor O'Sullivan
Greenhorn

Joined: Oct 18, 2008
Posts: 7
I ran it from the command line, and again nothing happens. The command prompt just re-appears.

Yes, I have set the entry point in Eclipse. This was done in the Exporting wizard.

The manifest file looks like this
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38481
    
  23
Is that manifest file finished with a blank line?
Victor O'Sullivan
Greenhorn

Joined: Oct 18, 2008
Posts: 7
Yes it is
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38481
    
  23
Don't know; you appear so far to have done everything correctly. What command are you using to start the jar from a command line?

And sorry we haven't been able to help any better yet.

[Edit]Alter inappropriate tongue smilie to something more appropriate (Sorry)[/edit]
[ December 04, 2008: Message edited by: Campbell Ritchie ]
Victor O'Sullivan
Greenhorn

Joined: Oct 18, 2008
Posts: 7
I had been just typing the name of the jar ... may have been a foolish mistake



But recently i tried



and the following exception occurred



Might this mean there is something missing from my Manifest file in realtion to the DB driver?
Victor O'Sullivan
Greenhorn

Joined: Oct 18, 2008
Posts: 7
I managed to solve my problem. I informed that I could not put a database driver into my jar file, so I created a .bat file to run a command to execute the jar file and connect to the sepertate driver.

A scincere thanks to everyone who helped along the way.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38481
    
  23
Well done sorting it out.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Problem with Jar