Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 195
  • Last Modified:

Problem to run jar file

Hi,
I can directly run the project fine, within Eclipse. But when I run it like

Z:\cmp2\Eclipse\JLib4>java -jar BankAcctNoValidator_049.jar
no main manifest attribute, in BankAcctNoValidator_049.jar

Open in new window

using the exported Jar, I get the problem in above. How to run the jar file?
0
HuaMinChen
Asked:
HuaMinChen
  • 2
1 Solution
 
HuaMinChenBusiness AnalystAuthor Commented:
0
 
CEHJCommented:
There's no Main-Class attribute in the manifest. You didn't export it properly

http://home.technojeeves.com/webtmp/BankAcctNoValidator_049.jar
0
 
HuaMinChenBusiness AnalystAuthor Commented:
Sorry, can I have the details to add Main-Class attribute? Thanks.
0
 
Ali Can AlbayrakSoftware EngineerCommented:
I guess you export it by choosing JAR FILE instead of RUNNABLE JAR configuration. If you export as a runnable jar, eclipse's export dialog will ask you where your main class is. Then it generates MANIFEST.MD file for you.
In MANIFEST.MD file, main class should be pointed.
Something like int the following:

Manifest-Version: 1.0
Class-Path: .
Main-Class: com.hkicl.ecp.hkanvm.b049.BankAcctNoValidator
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now