Results 1 to 7 of 7
- 10-09-2008, 09:56 AM #1Member
- Join Date
- Oct 2008
- Rep Power
Need help in java program execution...
I have made a java program( in JAR file) and I need to execute it from a single icon click from other software...can you please tell how to do it..For normal execution i have to go to CMD prompt and write a couple of commands but i want to execute it through 1 single click..
The method which i though was to direct the icon click to a batch(.bat) file and write the commands in it but its not working properly...do you have any other method
I am new to java and any help would be appreciated.
- 10-09-2008, 12:04 PM #2
What you mean a single click, respect to Windows. In XP and earlier version to start an application you have to use double click, if you are not enable the single click. In vista you have a nice tool bar on top of the desktop.
So basically to run/start an application you have to follow one of the above method.
You can use a single click with such an application. Solution is click-event.
- 10-09-2008, 02:25 PM #3its not working properly
What OS are you on? .bat files implies Windows.
execute it from a single icon click from other software.
When the jre is installed, .jar files should be associated with the java -jar <jarfile> command, so that if you "open"/double click on the jar file the java command is executed which reads the jar file and starts the app as specified in the Main-Class: line.
- 10-09-2008, 03:19 PM #4
I think he's talking about single click within an application, just like a click event on a button. I'm wonder too, other than that we can't use a single click to execute an application.
- 10-10-2008, 05:35 AM #5Member
- Join Date
- Oct 2008
- Rep Power
Sorry for the confusion guys...
My question is...
I have made a java application which is in Jar format....Now jar format by default opens with winrar or winzip...I wanted to know is there any way it can open with JAVA SE program on other user's comp when I distribute this application to other people who dont know java but have JRE installed on their comp.
1 method is to write" java -jar filename.jar" command in BAT file..and put it in same folder with JAR file but this show command prompt for few seconds which doesn't look good...I want that when I give this program, and user double click it, it should automatically open with JAVA...
So how to program this..
P.S: I want to develop it for win 2003,XP and vista
- 10-10-2008, 05:51 AM #6
If you have installed JRE, a jar files are start to execute using that, unless you don't have change the default application.
So the solution is use of a bat file, as you said. And also there are many ways to do that same thing in Java.
- 10-10-2008, 02:37 PM #7
What OS are you on?
If Windows, the java installation should have set the default commmandline to java -jar.
On windows, what do you see when you right click on the jar file? What are the top choices (above the gray line) in the menu?
What happens if you open a command prompt and enter: java -version
- By Ndt in forum Advanced JavaReplies: 25Last Post: 06-28-2008, 05:08 PM
- By Java Tip in forum java.ioReplies: 0Last Post: 04-04-2008, 02:40 PM
- By vital101 in forum Advanced JavaReplies: 3Last Post: 10-30-2007, 05:17 PM
- By JavaBean in forum Java TipReplies: 0Last Post: 10-04-2007, 09:33 PM
- By Eric in forum Advanced JavaReplies: 1Last Post: 06-27-2007, 03:52 PM