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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:03:27+00:00 2026-05-14T00:03:27+00:00

I am having problems having my Java programs see classes that are packaged in

  • 0

I am having problems having my Java programs see classes that are packaged in an external jar. I am running under Windows 7. I have the classes embedded in a jar called ParserUtilities.jar. I established the path with a CLASSPATH variable using the System utility and the Environment tab.
I confirmed that the CLASSPATH is set correctly. When I type echo %CLASSPATH%, I see
C:\Program Files\Java\externaljars\ParserUtilities.jar which is correct. But when I type
java -jar Parse.jar (my executable) I get the error
Exception in thread “main” java.lang.NoClassDefFoundError: com/artificialmed/Initialize

Some additional information:

  1. When I put the ParserUtilities.jar in the ..\lib\ext directory, everything works.
  2. I am running java version 1.6.0_16. Java(TM) SE Runtime Environment
  3. In experimenting, I typed java -cp C:\Program Files\Java\jre6\lib\ext>java -cp C:\Program Files\Java\externaljars\ParserUtilities.jar

and got this error “Could not find the main class: Files\Java\externaljars\ParserUtilities.jar” but there is no main class (its just a collection of classes I use in a bunch of programs).

I do not have a Java SDK loaded in the environment, just a java JRE (Is this the issue?).

  • 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-14T00:03:28+00:00Added an answer on May 14, 2026 at 12:03 am

    From Sun’s documentation on the -jar option to the java command: “When you use this option, the JAR file is the source of all user classes, and other user class path settings are ignored.” I believe that means that both your CLASSPATH environment variable as well as any -cp arguments that you might provide on the command line are both going to be ignored.

    So, you have the following options:

    1. Package everything into one jar, and then you can execute it by running java -jar JarWithEverything.jar.
    2. Keep things in separate jars and provide both jars as arguments on the command line, so that you type something like this:

      java -cp "C:\Program Files\Java\externaljars\ParserUtilities.jar";"C:\Program Files\Java\externaljars\Parser.jar" com.artificialmed.Initialize

    3. Keep things in separate jars and put one or both jars in your CLASSPATH environment variable instead of providing them on the command line.

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

Sidebar

Related Questions

I'm having a problem when running programs that use Java from the command line.
I'm having some problems with some commands in Java. I created a JAR that
I am having a problem running java programs in Eclipse, When i Click on
I am having problems with my java assignment. I have been working on it
I'm having problems trying to run a Java file that uses Apache Lucene. I
I'm having problems with a Java Regex Pattern Syntax expression. toCensor = toCensor.replaceAll((new StringBuilder(((?i)))).append(word).toString(),
Using a Java based image uploader and having problems, seems my controller action is
I'm having a problem that I have encountered before, but I still don't know
I am having problems with making multithreaded Datagram Sockets for learning purposes in java.
I'm having problems with creating mySQL table within Java program. I constantly get Can't

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.