Jar java file

I created a java application and packaged it into a jar file on a Windows platform. Now I want to deploy this jar file on Debian Linux.

  • Will the same jar file work on Debian Linux?

  • Is the command used on Windows to execute the jar file from the command line the same for Debain Linux?

i.e.

java -jvm "MyJar.jar"

Will the above command work on Debian Linux?

+3
source share
7 answers

Yes.

Jar files are portable across platforms, and the syntax of the jar command is the same for both Linux and Windows.


EDIT: Sun Java, . : http://wiki.debian.org/Java/Sun

+6

, . :

  • (JNI), , .
  • , , Windows ( , : vs.;)
+6

1. jar Debian Linux?

. , Java ( )

2. , Windows jar , Debain Linux?

java -jar "MyJar.jar"

+4

, java , , ​​ java.

-jvm.

jar, -jar.

java -jar "MyJar.jar"

Write once run where.

+2

Mac, Linux Windows. JNI, , java -jar "MyJar.jar"

+2

. :

java -jar "MyJar.jar"

, , JNI

+1

, Linux:

java -jar YourJar.jar

:

java -jvm YourJar.jar
+1
source

Source: https://habr.com/ru/post/1722204/


All Articles