Start a jar with a jar by doubleclick

Hey Guys,

First, sorry for my bad english, i hope you understand what i mean.

Ok, now my problem.

I use e Linux and i like to start an application by double klicking on a jar file. This jar file, does start en other jar file in the same path.

Why i'd like to do this. I the second jar, nead some OS specific options, so i'd like to recognise the os with de first jar. After that, id like to starte de Second with Runtime.getRuntime().exec("java -Djava.library.path=bla -jar second.jar");

When i start the first jar in e console, it works fine, but if i double klick it doesn't work. I find out, that, the double klicked jar starts in the home path, but i ned the path, where the double klicked jar is laying because the second is in the same path.

Thanks for your help

Gepi

[825 byte] By [fraenklia] at [2007-11-27 7:01:01]
# 1

Your first JAR file needs to know where to begin execution so to execute a JAR file by double clicking on it, the JAR file must be aware of what class contains the main method so it may begin execution.

This can be done easily by adding the

Main-Class: [class file]

parameter to your JAR's Manifest file.

maple_shafta at 2007-7-12 18:51:50 > top of Java-index,Desktop,Deploying...
# 2

I know that. I did it an it works, but only in windows and ond a mac. On both systems it seams that the execution path is the same like the path where i double klicked. But in linux, it executes de first in the home directory and not where i double klicked. How could i find out where the double klick happend or where the jar is actually liying?

Thanks for help

fraenklia at 2007-7-12 18:51:50 > top of Java-index,Desktop,Deploying...