-2

I have a server for Minecraft and i just recently updated to java 8 update 73, iIfollowed some tutorials to get it installed, I also use the command to set it as default... but only the jar files on the desktop can be run using java/java8 if it was in a file when I use the set default thing it doesn't allow me to use that jar file, same goes for jar files I download please help. I am using Peppermint 5.

4
  • What exactly you want to do?
    – Ashu
    Feb 10, 2016 at 0:50
  • I thought I made it pretty clear but... I want to know how to fix my jar files because they are acting like .zip files even though I have java 8 and i can't select java in the properties Feb 10, 2016 at 1:10
  • It is a java issue. The manifest for these jar files might not have an entry for entry point, i.e. the Main Class. Of course all jar files are zips. If you know the 'main class' inside your jar, you can invoke them from the terminal.
    – R.S.
    Feb 10, 2016 at 1:10
  • I agree with R.S. Verify the JAR file in some other system where Java is installed and it is working fine for other JAR files. If it works fine - then in your Ubuntu you have some issue with java. Otherwise it's the JAR file issue.
    – Ashu
    Feb 10, 2016 at 1:24

1 Answer 1

0

I will suggest install Oracle Java 8 following this

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer

Verify whether java is installed or not?

java -version

You should see something like this

root@ashu-700-430qe:/opt# java -version
java version "1.8.0_72"
Java(TM) SE Runtime Environment (build 1.8.0_72-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.72-b15, mixed mode)

To setup the environment variable accordingly

sudo apt-get install oracle-java8-set-default

In case it is not set,

sudo vi /etc/environment
JAVA_HOME='path of java before bin directory'
export JAVA_HOME
sudo source /etc/environment

Once that is done your should be doing something like this

java -jar <name of the JAR file> 

to execute it

Note : By default Ubuntu comes with openJDK so you already have java installed.

3
  • I did this before but I'll try it again Feb 10, 2016 at 1:21
  • It seems to have work, the jar files opened and ran the server thanks for all the help :D Feb 10, 2016 at 1:33
  • Glad to know it worked.Please accept this answer(tick mark against the answer)
    – Ashu
    Feb 10, 2016 at 1:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .