Results 1 to 5 of 5
Thread: About Executable JAR files
- 03-31-2009, 06:13 PM #1
Member
- Join Date
- Mar 2009
- Posts
- 8
- Rep Power
- 0
About Executable JAR files
Hello,
I am trying to understand executable JAR files.
I seem to be finding conflicting information.
One person tells me that when one creates an executable JAR file
it must be executed via command line, for example by Batch file(.bat) in windows.
But then I have downloaded example JAR files that when I double click it
executes like a regular windows .exe file.
Then what I found was : "If a java application is GUI based then the executable JAR file can be double clicked to activate the program".
BUT then I got another sample java program and it was GUI based
but the executable JAR file could not be clicked to run it , one had
to double click the Batch file that was included to run it.
SO I am getting conflicting results here.
My only conclusion is that there must be some kind of parameter setting
that may need to be set when creating the Executable JAR file.
Really appreciate it if somebody can clear up this confusion.
Sincerely,
Paluee
- 03-31-2009, 06:31 PM #2
that's correct."If a java application is GUI based then the executable JAR file can be double clicked to activate the program".
no... please post the batch file.My only conclusion is that there must be some kind of parameter setting
that may need to be set when creating the Executable JAR file.USE CODE TAGS--> [CODE]...[/CODE]
Get NotePad++ (free)
- 03-31-2009, 06:35 PM #3
Member
- Join Date
- Mar 2009
- Posts
- 8
- Rep Power
- 0
more on executable JAR files
Hello,
Thanks for your response, but I think I just found something.
It does have to do with JAR file creation it seems, it has something to do with
this thing called the Manifest file.
See this link below:
****java.ittoolbox.com/documents/executable-jar-files-18780****
************************************************** ****
When we see properties of any jar file it says its type as executable jar file. But it doesn't mean all jar files can be executed by double clicking.
But jar files can be made so that they can execute on double clicking.
For this jar file must have a class with
public static void main(String a[])
function and a manifest file declaring main class name present in jar file command is
jar -cmf manifest.mf exefile.jar *.class
manifest file should have
Jar-Version: 1.0
Main-Class: MainClassNameWithoutExtension
There should be at least 1 blank line after above entry.
************************************************** ***
So can you explain this explanation.
Paluee
- 03-31-2009, 06:47 PM #4
thats the rule for all jar, doesn't matter if its console or gui.
but that still doesn't explain why it only opens with a batch and not double-click. Unless... that jar file you had was not properly made.USE CODE TAGS--> [CODE]...[/CODE]
Get NotePad++ (free)
- 03-31-2009, 07:03 PM #5
Similar Threads
-
Executable java project ..
By xVent in forum Java AppletsReplies: 5Last Post: 03-29-2009, 06:46 PM -
executable files
By akinpam in forum Advanced JavaReplies: 10Last Post: 01-06-2009, 04:01 AM -
executable
By smooth in forum New To JavaReplies: 4Last Post: 06-14-2008, 05:12 PM -
Executable Java
By eva in forum New To JavaReplies: 3Last Post: 12-30-2007, 11:38 PM -
Executable JAR
By bugger in forum New To JavaReplies: 4Last Post: 12-05-2007, 05:41 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks