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??

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

2 Answers 2

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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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