aspose file tools*
The moose likes Beginning Java and the fly likes Executing a jar file from desktop Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Executing a jar file from desktop" Watch "Executing a jar file from desktop" New topic
Author

Executing a jar file from desktop

Jennifer Sohl
Ranch Hand

Joined: Feb 28, 2001
Posts: 455
Hello. I have created a shortcut on my desktop to javaw.exe. I am then specifying the directory that the jar file is in, and then the main class like this:

When I execute the jar file it works great.
However, I want to change the drive and directory that these jar files are located in. I copied the jar files to a different directory so now my target looks like this:

When I try to run this, it says it can't find the main class?? What am I forgetting? Why does it work in one directory and not the other?
Thanks for any help!
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
What does the Manifest in your Jar file say?


"JavaRanch, where the deer and the Certified play" - David O'Meara
Jennifer Sohl
Ranch Hand

Joined: Feb 28, 2001
Posts: 455
I exported these classes from VAJ 3.5.3 to a jar file, so the manifest file was automatically generated. It has A LOT of stuff in it. Do you want me to post all of it here?
Jennifer Sohl
Ranch Hand

Joined: Feb 28, 2001
Posts: 455
Cindy,
Nevermind, I figured out what I did wrong. Before I had just copied the jar file from one directory to another. I figured out I actually had to go back into Visual Age and actually export it to the new directory.
Thanks for the nudge!
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
No - just check to be sure that it does not reference anything in the OLD location.
Silly question, but you DID move the 2 jar files to the new location in E:\JavaApps didn't you?? Of course, of course . . . just checking.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Executing a jar file from desktop