Solved

Problem to run jar file

Posted on 2015-02-11
4
142 Views
Last Modified: 2015-02-11
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
Comment
Question by:HuaMinChen
  • 2
4 Comments
 
LVL 10

Author Comment

by:HuaMinChen
ID: 40602663
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 40602717
There's no Main-Class attribute in the manifest. You didn't export it properly

http://home.technojeeves.com/webtmp/BankAcctNoValidator_049.jar
0
 
LVL 10

Author Comment

by:HuaMinChen
ID: 40602811
Sorry, can I have the details to add Main-Class attribute? Thanks.
0
 
LVL 1

Accepted Solution

by:
Ali Can Albayrak earned 500 total points
ID: 40602880
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

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Have you ever had a hard drive that you can't boot into, but need to change the registry? Here is the solution! This article guides you through accessing and editing a registry of a non-primary drive. To read registry information on a non-prim…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now