Executing a Jar File in Linux

Executing a jar file in Linux

Heh, what @marc is trying to say in his comment is that how you do that could be wildly different depending on your linux flavor. In general, you just need to find out how to change the default "Open With" behavior for whichever flavor you're using. You need to tell it to open jar files with Java instead of with the archive program.

How can I execute .jar file from the terminal without specifying its name

I am not sure it would be a good idea to just run everything in a directory, but you could:

FOR %A IN ("*.jar") DO (java -jar "%~A")

Running .jar File on Linux

First, try running it on the command-line, with

java -jar <file.jar>

The user.dir property is cross-platform (see here) so it should not be the problem. However, are you using correct file separators? Remember it's '/' on UNIX and '\' on Windows.

how to run a jar file on the ubuntu 14.04 without stopping when i stopped the putty?

You can use nohup to run the jar(any process) in background.

Use the following command in the putty session :

nohup java -jar xxx.jar &


Related Topics



Leave a reply



Submit