Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / February 2007

Tip: Looking for answers? Try searching our database.

Creating a java executable

Thread view: 
KNelson - 19 Feb 2007 04:53 GMT
Hi, I would like to make a java executable.  I am aware I need to jar
it, I have the manifest file, and it will run when I type java -jar
This.jar
*** so I know the jar worked BUT, it will still not work when I double
click it.  That is what I want, I want to run it on the double click.
jar cvfm This.jar manifest.mft This.class      is what I am using to
make the jar.  When you respond to this, make sure you know your
method works on the double click, because I can get the jar to run
from the command line.  THANK YOU any help would be appreciated
Karl
Knute Johnson - 19 Feb 2007 04:55 GMT
> Hi, I would like to make a java executable.  I am aware I need to jar
> it, I have the manifest file, and it will run when I type java -jar
[quoted text clipped - 6 lines]
> from the command line.  THANK YOU any help would be appreciated
> Karl

Windows?

Signature

Knute Johnson
email s/nospam/knute/

KNelson - 19 Feb 2007 05:02 GMT
On Feb 18, 8:55 pm, Knute Johnson <nos...@rabbitbrush.frazmtn.com>
wrote:
> > Hi, I would like to make a java executable.  I am aware I need to jar
> > it, I have the manifest file, and it will run when I type java -jar
[quoted text clipped - 13 lines]
> Knute Johnson
> email s/nospam/knute/

Ok, let me make this clear, technically I do not want to make a
executable, I just want be able to double click on the program to run
it.  So I know I need to jar it, but I would like to know the exact
jar command.
Phi - 19 Feb 2007 06:22 GMT
> Hi, I would like to make a java executable.  I am aware I need to jar
> it, I have the manifest file, and it will run when I type java -jar
[quoted text clipped - 6 lines]
> from the command line.  THANK YOU any help would be appreciated
> Karl

Making JARs run at double click has nothing to do with java. This is a
behaviour of your operating system.
I use linux - gnome and use the following batch to start jar-files:

runjar.sh
> /usr/java/bin/java -jar $@

The first jar-file I had to open with "right click -> properties ->
open-with -> add; and I added the "runjar.sh" batch".
I marked the runjar.sh as the preferred application to start. Since
then, every jar file opens at double click.
KNelson - 19 Feb 2007 07:01 GMT
> > Hi, I would like to make a java executable.  I am aware I need to jar
> > it, I have the manifest file, and it will run when I type java -jar
[quoted text clipped - 19 lines]
> I marked the runjar.sh as the preferred application to start. Since
> then, every jar file opens at double click.

yes, it does have to do with java.  do your homework.  thanks
Proton Projects - Moin - 19 Feb 2007 07:56 GMT
> Hi, I would like to make a java executable.  I am aware I need to jar
> it, I have the manifest file, and it will run when I type java -jar
[quoted text clipped - 6 lines]
> from the command line.  THANK YOU any help would be appreciated
> Karl

Hi,

If u r using Windows...

open a command prompt....going to Start --> Run --> cmd

Enter the command: edit run.bat

type as " java -jar <jar file name>" excluding the Quotes

press Alt+f and s, and Alt+f +x

Go to the location where the .bat file is created...double click , u
can run the java application...this is the simplest way u can do it...

Other wise...u need to have a webstart to support in any operation
system..

Check out this linkk....which will help u a lot on double click of ur
app :-)

http://java.sun.com/docs/books/tutorial/deployment/webstart/index.html

Regards
Moin
Ian Wilson - 19 Feb 2007 11:15 GMT
> Hi, I would like to make a java executable.  I am aware I need to jar
> it, I have the manifest file, and it will run when I type java -jar
[quoted text clipped - 6 lines]
> from the command line.  THANK YOU any help would be appreciated
> Karl

You appear to be using Windows.

When I installed JDK and Eclipse on Windows, the appropriate file
associations were set up for me. I can double click a jar file (desktop
icon or Windows Explorer) to launch the application it contains.

http://support.microsoft.com/kb/307859

http://support.microsoft.com/kb/323526
Ian Wilson - 19 Feb 2007 11:28 GMT
>> Hi, I would like to make a java executable.  I am aware I need to jar
>> it, I have the manifest file, and it will run when I type java -jar
[quoted text clipped - 12 lines]
> associations were set up for me. I can double click a jar file (desktop
> icon or Windows Explorer) to launch the application it contains.

In case it's of any help ...

C:\>assoc .jar
.jar=jarfile

C:\>ftype jarfile
jarfile="C:\Program Files\Java\jre1.5.0_10\bin\javaw.exe" -jar "%1" %*

You can use assoc and ftype commands to create the above associations
(substituting whatever is appropriate for your JRE).

assoc /?
ftype /?

This question might have been more appropriate to comp.lang.java.help.
So I have crossposted it there and set followups accordingly.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.