Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Problem to run jar file

Posted on 2015-02-11
4
Medium Priority
?
182 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 11

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 11

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 1500 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Citrix XenApp, Internet Explorer 11 set to Enterprise Mode and using central hosted sites.xml file.
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Suggested Courses

636 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