Results 1 to 7 of 7
- 10-09-2008, 09:56 AM #1
Member
- Join Date
- Oct 2008
- Posts
- 2
- Rep Power
- 0
Need help in java program execution...
Hi all
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
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
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 #3
What does that mean? Are there error messages? Can you explain? Please post the error messages here.its not working properly
What OS are you on? .bat files implies Windows.
What does that mean? How does software do single icon click?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
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
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 #5
Member
- Join Date
- Oct 2008
- Posts
- 2
- Rep Power
- 0
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
Thanks
- 10-10-2008, 05:51 AM #6
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
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
Similar Threads
-
How can I improve the execution time of a Java Project
By Ndt in forum Advanced JavaReplies: 25Last Post: 06-28-2008, 05:08 PM -
How to execute an External Program through Java program
By Java Tip in forum java.ioReplies: 0Last Post: 04-04-2008, 02:40 PM -
External Program execution problems
By vital101 in forum Advanced JavaReplies: 3Last Post: 10-30-2007, 05:17 PM -
How to execute an External Program through Java program
By JavaBean in forum Java TipReplies: 0Last Post: 10-04-2007, 09:33 PM -
Execution cut
By Eric in forum Advanced JavaReplies: 1Last Post: 06-27-2007, 03:52 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks