Amedeo Braggio
Amedeo Braggio

Reputation: 25

Run linux java applications

So, my goal is to have a .desktop analyze it and start the program, the part where I extract the information from the .desktop I have already done, the problem is to start the applications, if I do

Desktop.getDesktop (). Open (file);

obviously it opens it to me with the system launcher, which I don't want, I wanted to know if there are any libraries that recognize the file and try to run it with the correct software (Appimage, jar and others are a problem, if not I could just do sh "path")

Upvotes: 0

Views: 199

Answers (1)

Dan Chirita
Dan Chirita

Reputation: 129

The .desktop file should point to a shell script which calls java on the needed application, or run java directly on the needed application (I guess it's a jar file).

java -classpath <classpath> -jar <path_to_your_jar>

Upvotes: 1

Related Questions