This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Java in General and the fly likes shortcut to java program issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "shortcut to java program issue" Watch "shortcut to java program issue" New topic
Author

shortcut to java program issue

Adamz Preston
Greenhorn

Joined: Jan 19, 2013
Posts: 29
Hi, so I need to create a shortcut to my java program. So far I created a batch file which has the line of code . However the problem with this is is that when I run, it runs from the location of the batch file and therefore the program doesn't work correctly. Is there any way that I can launch the java program using the actual jar? Any advice would be appreciated
K. Tsang
Bartender

Joined: Sep 13, 2007
Posts: 2379
    
    7

You can always use cd to the correct directory first or use the full path of the jar file.


K. Tsang JavaRanch SCJP5 SCJD/OCM-JD OCPJP7 OCPWCD5
Adamz Preston
Greenhorn

Joined: Jan 19, 2013
Posts: 29
K. Tsang wrote:You can always use cd to the correct directory first or use the full path of the jar file.


Thanks but thats not the problem, it is able to find the file but it loads in the batch files directory and not in the actual jar file. Please tell me if you are still confused and feel free to post any other ideas on how to create a reliable shortcut.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

I'm confused... I don't know what it means for a file to open in a jar file.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: shortcut to java program issue