views:

33

answers:

2

I'm not able to open my JAR file using the following code. Though, I'm able to open other JAR files.

try {  
        Desktop.getDesktop().open(new File("myPlugin.jar"));  
     }  
       catch(Exception exception) {  
        exception.printStackTrace();  
        }    
      }

I don't know if I'm exporting the JAR file incorrectly or some error in the Manifest file.

Manifest-Version: 1.0
Class-Path: .
Main-Class: Reader

Any help would be appreciated. Thanks.

A: 

maybe try putting in the full path to the file

Nilesh Tailor
It worked. Thank you!It looks like the error was not specifying the full path. Though, not specifying the full path worked for another JAR file. Any ideas?
Darth_Yoda
Reply to other comments above...There were no errors or exceptions, and the program compiles just fine. I am running it from a Groovy Console.
Darth_Yoda
A: 

Sounds like you are asking Windows to invoke your jar-file. Can you invoke it from CMD.EXE?

java -jar myPlugin.jar

My guess is that you get an error, which is silently discarded. Running from CMD.EXE will show you the problem.

Thorbjørn Ravn Andersen
The JAR file runs from the Command Prompt as well. No issues here.
Darth_Yoda