Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run .jar file on unix?

Tags:

java

unix

I have generated .jar file in windows.
I have to execute that .jar file in unix .

I am running that command (java -jar myJar.jar), but it's giving

 java.lang.UnsupportedVersionError

I am using java version 1.5.0.12 in Unix.

like image 779
musicking123 Avatar asked Aug 26 '09 10:08

musicking123


People also ask

How do I run a JAR file in Unix?

When we see the main window of JD-GUI, we can either open our JAR file by navigating the menu “File -> Open File…” or just drag-and-drop the JAR file in the window. Once we open a JAR file, all the classes in the JAR file will be decompiled.

How do I run a .JAR file?

To run an application in a nonexecutable JAR file, we have to use -cp option instead of -jar. We'll use the -cp option (short for classpath) to specify the JAR file that contains the class file we want to execute: java -cp jar-file-name main-class-name [args …]


1 Answers

Same as under Windows.

java -jar file.jar
like image 141
Bombe Avatar answered Oct 20 '22 00:10

Bombe