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 8611253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T04:19:46+00:00 2026-06-12T04:19:46+00:00

I have a jar called GameClient.jar which has a main method. And I have

  • 0

I have a jar called GameClient.jar which has a main method. And I have a json.jar which does contain an org/json/JSONException.class

Both of these are in the dist folder.

I run the following
java -classpath dist/json.jar -jar dist/gameclient.jar

Not really sure why I still get

Exception in thread "main" java.lang.NoClassDefFoundError: org/json/JSONException
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
    at java.lang.Class.getMethod0(Unknown Source)
    at java.lang.Class.getMethod(Unknown Source)
    at sun.launcher.LauncherHelper.getMainMethod(Unknown Source)
    at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)

Caused by: java.lang.ClassNotFoundException: org.json.JSONException

I am on Windows XP and Java 1.7. I get the same error with or without the classpath option.

  • 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-06-12T04:19:48+00:00Added an answer on June 12, 2026 at 4:19 am

    From the java documentation:

    -jar

    Execute a program encapsulated in a JAR file. The first argument is the name of a JAR file
    instead of a startup class name. In order for this option to work, the manifest of the JAR
    file must contain a line of the form Main-Class: classname. Here, classname identifies the
    class having the public static void main(String[] args) method that serves as your appli-
    cation’s starting point. See the jar(1) and the Jar trail of the Java Tutorial @
    http://java.sun.com/docs/books/tutorial/jar for information about working with Jar files
    and Jar-file manifests.

    When you use this option, the JAR file is the source of all user classes, and other user
    class path settings are ignored.

    So your gameclient.jar must include all of the user classes that you need. The classpath setting is ignored. Just create the gameclient.jar to include the classes in json.jar.

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

Sidebar

Related Questions

I have a jar file of my application which has more than one class.
I have a JAR file which may be called manually or by Java Web
I have a .jar file called install.jar, which copies various file types to %appdata%/folder/abc/
does any knows how to access .jar file in JS. I have created class
I have created a bat file which calls selenium server called run-selenium-server.bat which has:
I have created the class like below. But Override method is not called. Is
I have a third party java program called kgsgtp.jar which need to communicate with
I have created a jar which needs to be called in a bat file.
I have an external library(just one class file called org.vinay.dep.DependedClass).It is well within its
I have a jar library. I used Java Class File Editor (CE) to modify

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.