Paritosh Dahiya
Paritosh Dahiya

Reputation: 15

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

Upvotes: 1

Views: 31906

Answers (3)

Janos Vinceller
Janos Vinceller

Reputation: 1266

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).

Upvotes: 7

Kalpesh Chaniyara
Kalpesh Chaniyara

Reputation: 11

Your Manifest file should contain a line:

Main-Class: classname

See "Setting an Application's Entry Point".

Upvotes: 0

Joe
Joe

Reputation: 1342

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

Upvotes: 4

Related Questions