Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 29-10-2009
Member
 
Join Date: Aug 2009
Posts: 51
How to run a jar file

I created a small jar file called HelloWorld using Matlab Java Builder tool. But although creating the jar file so good, I could not run it. What is the exact command to use? On internet, it said to use this:
Code:
% java -classpath D:\Matlab\toolbox\javabuilder\jar\javabuilder.jar;hello.jar examples.hello
but this does not work!

It gave me the error as:
Quote:
'%' is not recognized as internal or external command, operable program or batch file.
If I remove the %, the error is:
Quote:
Failed to load Main-Class manifest attribute from D:\Matlab\toolbox\javabuilder\jar\hello.jar
Can you help me please?
Reply With Quote
  #2  
Old 29-10-2009
Member
 
Join Date: Jan 2008
Posts: 1,515
Re: How to run a jar file

Try the following from MS-DOS console:

Code:
java-jar hello. jar
Reply With Quote
  #3  
Old 29-10-2009
Member
 
Join Date: Aug 2009
Posts: 51
Re: How to run a jar file

Thank you for your response, DOS returns an error of Manifest:

Code:
Failed to load Main-Class manifest attribute from 
hello. jar
This is the event in question (open with Eclipse):

Code:
Manifest-Version: 1.0
Created-By: 1.6.0_16 (Sun Microsystems Inc.)
Reply With Quote
  #4  
Old 29-10-2009
XSI XSI is offline
Member
 
Join Date: May 2008
Posts: 271
Re: How to run a jar file

you can extract the contents of your file with the command hello.jar
Code:
jar xvf hello.jar
Your manifest must be of type
Code:
Manifest-Version: 1.0
Main-Class: Hello 
Class-Path: ./
Hello is the main class (containing the method "main")
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to run a jar file"
Thread Thread Starter Forum Replies Last Post
How can I convert LaTeX file to OpenOffice .odt file and MS Word .doc file? Charu Sharma Windows Software 4 04-04-2012 01:12 AM
I cannot file ?Confirm open after Download" checkbox for file types in Windows 7 Dalapathi Operating Systems 4 07-02-2011 10:19 AM
Dead space 2 error while installation "Source file not found: (file destination)...Verify that file exists Ucchal Video Games 3 28-01-2011 06:26 AM
How to setup File Replication Service and Distributed File System in Windows 2003 Computer_Freak Tips & Tweaks 1 17-07-2009 07:09 PM
How can i make .cab file and would like to add file to an existing cab file Kamran Operating Systems 3 16-07-2009 01:29 PM


All times are GMT +5.5. The time now is 04:43 AM.