简体   繁体   中英

Executable jar not running? Windows 10

I am having various .jar files in my system. I have the JDK and JRE installed. Most of jar files run on double clicking, but there are 2 - 3 jar files which do nothing on clicking. Help me. By the way I am using windows 10 64 bit

Problem:

I could not start JAR files just by clicking on them in Windows 10. I was messing around with the "control panel" ... forget it.

What I've found out:

  1. Start a command line (cmd) as an Administrator
  2. Check your file type association:

     ftype jarfile assoc .jar
  3. I had to change my java path to a different one

    ftype jarfile=C:\\myjavapath\\javaw.exe -jar "%1" %*

    Which basically means, that if someone starts a jar file, the command would be:

     C:\\myjavapath\\javaw.exe -jar "example.jar" parameter1 parameter2
  4. For me, I also had to change my .lnk files to only contain the name of the jar file, not the whole command. Type in the whole path of the jar file in the "target" field in the properties of the link file (.lnk).

You can debug it in the Command Prompt.

Open start, type in CMD.exe , hit enter

Then, type in

java -jar "path\\to\\file.jar" without the quotes

or

java "path\\to\\file.jar"

You should be able to see an output log of what is happening that is making the jar file not execute properly

Your Manifest file should contain a line:

Main-Class: classname

See " Setting an Application's Entry Point" .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM