• Welcome to OS2World OLD-STATIC-BACKUP Forum.
 

News:

This is an old OS2World backup forum for reference only. IT IS READ ONLY!!!

If you need help with OS/2 - eComStation visit http://www.os2world.com/forum

Main Menu

Creating Java Icons on desktop?

Started by os2monkey, 2007.11.08, 12:53:44

Previous topic - Next topic

os2monkey

Hi, So far I have been loading java programs manually from command line via:
c:\java141\bin\java -jar filename.jar

I was just wondering if there is a way to create a desktop icon to do the above command or to auto run a jar file, since obviously that would save me some time.

Thanks!


melf

Make a program object of java.exe (right click>"create program object"). Add -jar in the parameter field, in "properties". Also in properties you could set in association page so jar-files become associated with that programobject (*.jar>ADD). When thats done, just doubleclick on jarfiles. (Or make a shadow on desktop and drop files in it) Both methods should work.
/Mikael

jep

Hi os2monkey,

Yes, of course you can create an icon on you desktop to start both specific apps and ones you come across and just want to drag&drop to test out.

1) Right click on the desktop, select "Create new" -> "Program"
2) Right Click on the icon created and select "Properties"
3) In the Tab "Program" enter the following information, adjusted to your system of course
  a) enter the path to you java installation under "Path and filename:", e.g. "C:\java141\bin\java.exe" without quotes
  b) enter parameters under "Parameters", e.g. "-jar %**P\%**F" without quotes
4) Switch to the tab "Session" and check the box "Start minimized" so you don't see the Command Line Window, just the java app.
5) Switch to the Tab "Icon" and add some cool icon to it so you know what to do with it.
6) Drag the jar-file on the icon to start the java app.

Note: Create a new Icon and replace "%**P\%**F" with your the path and filename of your jar-file if you want to make it permanent, then you just have to double click it to start the java app.

Read more about [] and %**-parameters under help to see more things you can do...

mvh / wkr / mfg
//Jan-Erik

Radek

One more hint: javaw.exe is a PM java runtime, which does not use command window at all. If filename.jar is a PM app (it creates its own window after java -jar filename.jar), then use javaw instead of java. Therefore:

- Create a program object
- Program name: javaw.exe
- Parameters: filemane (it's enough, no need for '-jar', filename must be .jar or .zip)
- Default dir: as needed

- Other settings: as needed

os2monkey

Thanks everyone for your tips.