1

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

1
  • have you checked whether those jars contain a valid (and correct) manifest file? Commented Jan 22, 2018 at 11:03

3 Answers 3

7

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

Sign up to request clarification or add additional context in comments.

Comments

4

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

Comments

0

Your Manifest file should contain a line:

Main-Class: classname 

See "Setting an Application's Entry Point".

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.