Announcement

Collapse
No announcement yet.

How to use Oracle Java

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to use Oracle Java

    Hi,

    I would like to use Oracle java, as not all java software can use open jdk.
    The problem is how to run a jar file.

    I downloaded the latest java version from the oracle site, and unpacked it.
    Then I downloaded a jar file to try it, and made it executable, but it does not run.
    When I try to run it with openjdk, it says it needs oracle java.
    When I try to run it with oracle java, I get this

    I copied the jar file into the same directory as the java runtime and made it executable
    and then I try to run it from the terminal.

    marc@marc-samsung:/data/Downloads/jre1.8.0_241/bin$ ./java Mario.jar
    or
    marc@marc-samsung:/data/Downloads/jre1.8.0_241/bin$ ./java /data/Downloads/jre1.8.0_241/bin/Mario.jar
    Error: Could not find or load main class .data.Downloads.jre1.8.0_241.bin.Mario.jar

    I am an absolute beginner with java, so I may be overlooking something basic.
    Je suis Charlie, how many more people have to die for religions
    linux user #447706 on https://linuxcounter.net
    A good place to start:
    Topic: Top 20 Kubuntu FAQs & Answers


    #2
    Did you try:
    java -jar Mario.jar


    Did you check to see if your Oracle java executable is in your PATH? If not, did you add it to $PATH?
    "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
    – John F. Kennedy, February 26, 1962.

    Comment


      #3
      Thanks for your help, the -jar option did the trick
      Je suis Charlie, how many more people have to die for religions
      linux user #447706 on https://linuxcounter.net
      A good place to start:
      Topic: Top 20 Kubuntu FAQs & Answers

      Comment

      Working...
      X