Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7702077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:08:37+00:00 2026-05-31T23:08:37+00:00

I am trying to run a jar file using my command prompt (Windows XP)

  • 0

I am trying to run a jar file using my command prompt (Windows XP) but get NoClassDefFoundError.

I have my DateAndTime.class file in a folder called dateandtime and also indicated a package called dateandtime in the source file.

Outside the folder I have a manifest.mf file with specification

Main-Class: dateandtime.DateAndTime

I put this in the command file

jar cmf manifest.mf myJarFile.jar dateandtime

and this creates the myJarFile.jar in the same folder as manifest.mf.

When I try to run this jar file however I get the NoClassDefFoundError

java -jar myJarFile.jar

If I jave all the classes in the same directory with no package specified then the .jar file runs fine but as soon as I try to specify a package, even though myJarFile.jar was created I get the error.

Why is that?

Regards

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T23:08:39+00:00Added an answer on May 31, 2026 at 11:08 pm

    If you are getting a NoClassDefFoundError it means a class that was present during compilation of your classes is absent during their execution. Which implies that you JAR file does not contain all the dependencies requires by your classes in order to run. Since your question is lacking detail on your project structure I can only recommend you revisit your application’s dependency tree and determine all the classes that need to be included in the JAR.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to run a .jar file that I have created using either
I am trying to run a jar using this command in my shell script
I have created a jar file usign maven2 build. I am trying to run
I've been trying to run a jar file - let's call it test.jar -
I am trying to run a jar with the log4j.xml file on the file
I am trying to run this dreadfully simple command in Bash java -cp nasa-top-secret.jar
I'm trying to dynamically run a .jar from a C# assembly (using Process.Start(info) ).
I'm trying to use Class.forName to dynamically load a class from a .jar file
I'm trying to construct a jar file using the Amazon Mechanical Turk API. The
I'm trying to code sign a JAR file and am using JDK 1.7u1. We

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.