Creating a java executable

K

KNelson

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
 
K

Knute Johnson

KNelson said:
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

Windows?
 
K

KNelson


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.
 
P

Phi

KNelson said:
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

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.
 
K

KNelson

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


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.

yes, it does have to do with java. do your homework. thanks
 
P

Proton Projects - Moin

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

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
 
I

Ian Wilson

KNelson said:
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

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
 
I

Ian Wilson

Ian said:
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.

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top