start java program from desktop or start menu

Reply

Join Date: Aug 2007
Posts: 164
Reputation: Ravenous Wolf is an unknown quantity at this point 
Solved Threads: 1
Ravenous Wolf Ravenous Wolf is offline Offline
Junior Poster

start java program from desktop or start menu

 
0
  #1
Oct 27th, 2008
Hi

Can anyone please tell me whether I can write a java program and start it in a way other that involves the command line? And not applets either.

I want to start writting all of our company software in java, leaving behind c#. But the problem is I can only run java programs from the command line using the java command. End users will not like this.

Is there anyway to make java programs more user friendly By providing a shortcut on the desktop and adding it to the start menu.

Thanks in advance
Rav Wolf
... what society overwhelmingly asks for is snake oil. Of course, the snake oil has the most impressive names —otherwise you would be selling nothing— like "Structured Analysis and Design", "Software Engineering", "Maturity Models", "IPSE", "MIS", "OO", "BPRE".... by Edsger W. Dijkstra
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 490
Reputation: Acidburn is an unknown quantity at this point 
Solved Threads: 5
Acidburn Acidburn is offline Offline
Posting Pro in Training

Re: start java program from desktop or start menu

 
0
  #2
Oct 27th, 2008
Yeh compile it and use the *.jar file. All the java command does is compile it? Could be wrong here.
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 164
Reputation: Ravenous Wolf is an unknown quantity at this point 
Solved Threads: 1
Ravenous Wolf Ravenous Wolf is offline Offline
Junior Poster

Re: start java program from desktop or start menu

 
0
  #3
Oct 27th, 2008
I am not sure if you are right.

the javac command compiles it. the java command starts the virtual machine, load the specified class and invoke function main. in other words its the same as clicking a program icon on the start menu.
Last edited by Ravenous Wolf; Oct 27th, 2008 at 4:04 am.
... what society overwhelmingly asks for is snake oil. Of course, the snake oil has the most impressive names —otherwise you would be selling nothing— like "Structured Analysis and Design", "Software Engineering", "Maturity Models", "IPSE", "MIS", "OO", "BPRE".... by Edsger W. Dijkstra
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 7
Reputation: eng.hosam84 is an unknown quantity at this point 
Solved Threads: 0
eng.hosam84 eng.hosam84 is offline Offline
Newbie Poster

Re: start java program from desktop or start menu

 
0
  #4
Oct 27th, 2008
Hi Rav Wolf ,
when you compile your java code , a .jar file is created .. then you can use any of the progras that converts jar to exe such as "installJammer" , InstallJammer creats a .exe file from the .jar file ..

I hope i helped you ..
any question i'll be there .

thanks

best regards.
eng.Hosam
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 164
Reputation: Ravenous Wolf is an unknown quantity at this point 
Solved Threads: 1
Ravenous Wolf Ravenous Wolf is offline Offline
Junior Poster

Re: start java program from desktop or start menu

 
0
  #5
Oct 27th, 2008
thanks. i'll go check it out. will get back to you hopefully soon. thanks again.

@acidburn.
thanks to you too. it seems you were on the right track.

cheers
... what society overwhelmingly asks for is snake oil. Of course, the snake oil has the most impressive names —otherwise you would be selling nothing— like "Structured Analysis and Design", "Software Engineering", "Maturity Models", "IPSE", "MIS", "OO", "BPRE".... by Edsger W. Dijkstra
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 807
Reputation: stultuske is a jewel in the rough stultuske is a jewel in the rough stultuske is a jewel in the rough 
Solved Threads: 100
stultuske's Avatar
stultuske stultuske is offline Offline
Practically a Posting Shark

Re: start java program from desktop or start menu

 
0
  #6
Oct 27th, 2008
Originally Posted by eng.hosam84 View Post
Hi Rav Wolf ,
when you compile your java code , a .jar file is created .. then you can use any of the progras that converts jar to exe such as "installJammer" , InstallJammer creats a .exe file from the .jar file ..

I hope i helped you ..
any question i'll be there .

thanks

best regards.
eng.Hosam
when you compile, a .class file is created. not everyone uses an ide which automatically generates .jar files. a.jar file is basically a structured .zip file, used as a executable file for java progs
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 2,227
Reputation: BestJewSinceJC is a splendid one to behold BestJewSinceJC is a splendid one to behold BestJewSinceJC is a splendid one to behold BestJewSinceJC is a splendid one to behold BestJewSinceJC is a splendid one to behold BestJewSinceJC is a splendid one to behold BestJewSinceJC is a splendid one to behold 
Solved Threads: 273
BestJewSinceJC BestJewSinceJC is offline Offline
Nearly a Posting Maven

Re: start java program from desktop or start menu

 
0
  #7
Oct 27th, 2008
If you want to create a jar very easily, one way you can do it is by using the Eclipse IDE. To create a jar in eclipse,

file-> export -> Jar File (this might be listed under 'java' -> next, and under manifest class you would select the main class that you want to run when the program is started,.
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 4,680
Reputation: Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future 
Solved Threads: 554
Moderator
Featured Poster
Ezzaral's Avatar
Ezzaral Ezzaral is offline Offline
Industrious Poster

Re: start java program from desktop or start menu

 
0
  #8
Oct 27th, 2008
There is no reason you need to create an .exe from the jar file (and many reasons not to). Just read the tutorial on packaging applications as jar files: http://java.sun.com/docs/books/tutor...jar/index.html

For your shortcut, you can simply use the same syntax that you would to run it from the command line. If you don't want the command window to persist while it's running, use "javaw" instead of "java"
  1. javaw -jar MyApp.jar
. You can add any switches you might need.

If you want to provide an installer for the app, you might take a look at IzPack.
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 1
Reputation: shruti123 is an unknown quantity at this point 
Solved Threads: 0
shruti123 shruti123 is offline Offline
Newbie Poster
 
0
  #9
Oct 27th, 2009
hi. ! can anybody tell me how can i construct menu in a simple java program..in which i use switch statements for addition,multiplication and subtraction purposes. i will be very thankful to u..... shruti thakur.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Java Forum


Views: 1251 | Replies: 8
Thread Tools Search this Thread



Tag cloud for Java
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2010 DaniWeb® LLC