Solved

Running a JAR file in windows cmd.

Posted on 2004-09-21
3
713 Views
Last Modified: 2013-12-11
I have use WSAD 5.0 to export a jar file with main class.

When i try to use my windows cmd promt to run the jar file with the following command:

java -jar e:\myjar.jar

it can success run the main class, but when it is trying to access the class within ANOTHER jar file included in myjar.jar lib folder, I got a NoClassDefFoundError for that class.

How can I solve it?

Thanks.
0
Comment
Question by:nkan
[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
3 Comments
 
LVL 14

Expert Comment

by:boonleng
ID: 12120837
You can put a jar file inside another jar file.

Place it outside the jar file, then set the classpath in the Manifest.mf e.g.
Manifest-Version: 1.0
Main-Class: com.test.MainClass
Class-Path: another.jar

Or place the classpath during execution
java -classpath another.jar -jar myjar.jar
0
 
LVL 14

Accepted Solution

by:
boonleng earned 50 total points
ID: 12120865
opps..
should be You cant put a jar file inside another jar file.
0
 
LVL 5

Expert Comment

by:apparition
ID: 12184664
Try

java -cp one.jar;myjar.jar
0

Featured Post

Create the perfect environment for any meeting

You might have a modern environment with all sorts of high-tech equipment, but what makes it worthwhile is how you seamlessly bring together the presentation with audio, video and lighting. The ATEN Control System provides integrated control and system automation.

Question has a verified solution.

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

This article is about some of the basic and important steps to be used to improve the performance in web-sphere commerce application development. 1) Always leverage the Dyna-caching facility provided by the product 2) Remove the unwanted code …
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Suggested Courses

627 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