0

I have installed JDK 8 and JRE 8 however whenever I try to open .jar files nothing happens. E.g. in terminal I type java -jar filename.jar then it just takes me to my next terminal input.

If I open-with it from my desktop, I get the timer-cursor (as if it was loading), but then again nothing happens.

What am I doing wrong??

  • 1
    Have you updated your $PATH and made it your default in .profile? – Ricardo Mar 20 '17 at 23:08
  • how would I do that? – Maffs Mar 20 '17 at 23:13
0

Ensure you have updated your PATH and made it your default in .profile.

Please see detailed instructions from Java here.

From memory, last time I did it, I think I edited this file:

~/.profile

And specified like this:

export PATH=/usr/local/jdk1.8.0/bin:$PATH

Hope that helps.

2

When you type java -version at your command prompt what response do you get?

If you get a response indicating the JVM and version number, you will know Java has been installed correctly.

If you echo $JAVA_HOME
the response should be your path to Java install.

Assuming these two items are working and your executable still doesn't work, then you need to define your main entry point into your program.

  • echo $JAVA_HOME returns nothing – Maffs Mar 22 '17 at 23:35
  • java -version works fine – Maffs Mar 22 '17 at 23:50
  • I'm so confused – Maffs Mar 22 '17 at 23:50
  • Deep breathe....... which OS you are using? Can you provide the information returned from the command echo $JAVA_HOME? – mike Mar 23 '17 at 0:23
  • I assume you are using OpenJDK, but would like to be sure. – mike Mar 23 '17 at 0:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.