0

So I've installed Java 8 via PPA using this method: http://tecadmin.net/install-oracle-java-8-jdk-8-ubuntu-via-ppa/

And it seems to be working:

jamie@jamie-ncase:/media/fa7e62a0-92d8-4af6-86d9-bdf5a38e786a/Steam/steamapps/common/Medieval II Total War/share/data/mods/ebii$ java -version
java version "1.8.0_91"
Java(TM) SE Runtime Environment (build 1.8.0_91-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode)
jamie@jamie-ncase:/media/fa7e62a0-92d8-4af6-86d9-bdf5a38e786a/Steam/steamapps/common/Medieval II Total War/share/data/mods/ebii$ 

I've tried to start my java file (wf_switcher.jar) by double clicking on it, but nothing happens so I am trying to open the file through terminal to see whats going wrong.

When I try and run a java .jar file I get this error:

jamie@jamie-ncase:/media/fa7e62a0-92d8-4af6-86d9-bdf5a38e786a/Steam/steamapps/common/Medieval II Total War/share/data/mods/ebii$ java wf_switcher.jar
Error: Could not find or load main class wf_switcher.jar
jamie@jamie-ncase:/media/fa7e62a0-92d8-4af6-86d9-bdf5a38e786a/Steam/steamapps/common/Medieval II Total War/share/data/mods/ebii$ javac wf_switcher.jar
error: Class names, 'wf_switcher.jar', are only accepted if annotation processing is explicitly requested
1 error

And I don't know why it isn't working. Can anyone help?

1
  • 1
    Try java -jar wf_switcher.jar Jul 8, 2016 at 18:56

1 Answer 1

5

To run a .jar file using Java, you need to use the -jar option on the command line. So to open wf_switcher.jar, you should run:

java -jar wf_switcher.jar

You must log in to answer this question.

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