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

  • Home
  • SEARCH
  • 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 3722768
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T06:01:32+00:00 2026-05-19T06:01:32+00:00

I am trying to run a jar file I made, I keep getting this

  • 0

I am trying to run a jar file I made, I keep getting this error:

     java -jar Client.jar
Exception in thread "main" java.lang.NoClassDefFoundError: Client (wrong name: Client/Client)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
    at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

I used this command

jar cmf Client.mf Client.jar Client.class Client.java Client

where Client.mf is:

  Manifest-Version: 1.0
  Main-Class: Client

The last argument is a folder containing all the depency classes:

ButtonListen.class
ButtonListener.class
Client$1.class
Client$2.class
Client$3.class
NewPage.class
NewPage.java
NextPage.class
NextPage.java
OptIPDemo$1.class
OptIPDemo$2.class
OptIPDemo$3.class
OptIPDemo$4.class
OptIPDemo$5.class
OptIPDemo$Doc$1.class
OptIPDemo$Doc.class
OptIPDemo.class
OptIPDemo.java
ServerStats.class
ServerStats.java
blue2.jpeg
blue3.JPG

For whatever reason it is giving me a NoClassDefFoundError, but I dont know why, or how to resolve it.

  • 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-19T06:01:33+00:00Added an answer on May 19, 2026 at 6:01 am

    You either need to compile with -d

    javac -d classes
    

    …or move all your classes into a classes/Client directory

    mkdir classes/Client
    mv *.class classes/Client
    

    Then, adjust your manifest to use a package-qualified Main-Class:

    Main-Class: Client.Client
    

    And finally, build the jar so that the classes are located within the Client directory of the jar:

    cd classes
    jar cmf ../Client.mf ../Client.jar *
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to run a .jar file with the command java -jar Filename.jar, but
I've been trying to run a jar file - let's call it test.jar -
I'm trying to run a .jar file on my centos box, but it says
I am trying to run a Jar file in the backend of my php
I'm trying to run a batch file, as another user, from my web app.
I am trying to run the wsdl2java command on a WSDL file that was
I'm trying to run .class file from command line. It works when I manually
What is the jar file containing the class: com.sun.enterprise.naming.impl.SerialInitContextFactory I am getting the following
I'm trying to run TinyFbClient (tiny facebook client) and it needs to import javax.ws.rs.core.UriBuilder
I am new to eclipse + Java. I am trying to create executable jar

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.