Solved

Problem to run jar file

Posted on 2015-02-11
4
155 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 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
maven disable workspace resolution 1 76
Java program running SQL query 5 62
Need Help! Getting a syntax error and don't understand why 3 55
Setup GlassFish 4 55
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…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Suggested Courses

734 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