Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with Jar

 
Victor O'Sullivan
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 49789
69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How did you set the entry point in Eclipse?

Have you read the Java Tutorials section?
 
Amirtharaj Chinnaraj
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
check do you have main class in your jar and if it is ok
add mainfiest to your jar
 
Maneesh Godbole
Saloon Keeper
Posts: 11092
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Victor O'Sullivan
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 49789
69
 
Victor O'Sullivan
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes it is
 
Campbell Ritchie
Sheriff
Pie
Posts: 49789
69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 49789
69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well done sorting it out.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic