Run .jar file with Centos java command

I try to run the .jar file in my centos field, but it says: "java: command not found".

What is the best or easiest way to solve this problem? I was hoping for the yum command, but not sure if this would exist for java?

+3
source share
4 answers

You can use this command to check if Java is available in your repository:

yum list | grep java

It should return something like this:

java-1.6.0-openjdk
java-1.6.0-sun

If such a package exists, you can install it using the following command (run it as root):

yum install java-1.6.0-openjdk
+4
source

-, CentOS JVM - . . Java CentOS 4 CentOS 5.

+5

Either the JRE is not installed, or most likely its location is not included in the environment variable PATH. If the executable is javanot in yours PATH, you will need to use the full path and file name to execute it.

+3
source

go to the folder with the jar file

C: \ temp> java -jar sample.jar

0
source

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


All Articles