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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:53:27+00:00 2026-05-31T07:53:27+00:00

I can’t compile my Program.java from the command line (only in Eclipse). When I

  • 0

I can’t compile my Program.java from the command line (only in Eclipse).
When I want to compile it with

javac Program.java

“cannot find symbol” errors occur at JUnit classes.

Eclipse has the JUnit classes in it’s plugins, but to compile it on my own I would need to somehow compile my JUnit.jar with the program. How can I do that? It doesn’t seem to work with

javac -cp absolutePathTo\JUnitJar Program.java

Or is this problem maybe caused because the JUnit classes are not implemented in my (nested) new Thread classes?

    C:\Documents and Settings\xxxx\Desktop\eclipse\xxxx\Program\src\da
    ta>javac -cp junit-4.10.jar Testworks.java
    Program.java:81: package org.junit.runner does not exist
    import org.junit.runner.Description;
                           ^
    Program.java:82: package org.junit.runner does not exist
    import org.junit.runner.JUnitCore;
                           ^
    Program.java:83: package org.junit.runner does not exist
    import org.junit.runner.Request;
                           ^
    Program.java:84: package org.junit.runner does not exist
    import org.junit.runner.Result;
                           ^
    Program.java:85: package org.junit.runner.notification does not exist
    import org.junit.runner.notification.Failure;
                                        ^
    Program.java:86: package org.junit.runner.notification does not exist
    import org.junit.runner.notification.RunListener;
                                        ^
    Program.java:253: cannot find symbol
    symbol  : class JUnitCore
    location: class data.Program
            JUnitCore jCore; //-> Core Runner - has no pleaseStop()
            ^
    Program.java:254: cannot find symbol
    symbol  : class RunListener
    location: class data.Program
            RunListener jRl;
            ^
    Program.java:255: cannot find symbol
    symbol  : class Request
    location: class data.Program
            Request jRq;
            ^
   Program.java:2167: cannot find symbol
    symbol  : class RunListener
    location: class data.Program
            class RlOne extends RunListener{
                                ^
    Program.java:2170: cannot find symbol
    symbol  : class Description
    location: class data.Program.RlOne
                            public void testRunStarted(Description descRun)
                                                       ^
    Program.java:2179: cannot find symbol
    symbol  : class Description
    location: class data.Program.RlOne
                            public void testStarted(Description descStart)
                                                    ^
    Program.java:2185: cannot find symbol
    symbol  : class Description
    location: class data.Program.RlOne
                            public void testFinished(Description descFinish)
                                                     ^
    Program.java:2202: cannot find symbol
    symbol  : class Failure
    location: class data.Program.RlOne
                            public void testFailure(Failure failure)
                                                    ^
    Program.java:2211: cannot find symbol
    symbol  : class Description
    location: class data.Program.RlOne
                            public void testIgnored(Description descIgno)
                                                    ^
    Program.java:2221: cannot find symbol
    symbol  : class Result
    location: class data.Program.RlOne
                            public void testRunFinished(Result result)
                                                        ^
    Program.java:2422: cannot find symbol
    symbol  : variable Request
    location: class data.Program.ThirdThread
                                    jRq = Request.aClass(cRun);
                                          ^
    Program.java:2426: cannot find symbol
    symbol  : variable Request
    location: class data.Program.ThirdThread
                                    jRq = Request.method(cRun, comb_meth.getSelected
    Item().toString());
                                          ^
    Program.java:2584: cannot find symbol
    symbol  : class JUnitCore
    location: class data.Program
                            jCore = new JUnitCore();
                                        ^
    19 errors

The java command output when I want to start it by the Eclipse compiled Program.class:

C:\Documents and Settings\xxxx\Desktop\eclipse\xxxx\Program\bin\da
ta>java Program
Exception in thread "main" java.lang.NoClassDefFoundError: Program
Caused by: java.lang.ClassNotFoundException: Program
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: Program.  Program will exit.
  • 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-31T07:53:29+00:00Added an answer on May 31, 2026 at 7:53 am

    Now I got it to work.

    I renamed junit-4.10.jar to junit.jar, moved it to another folder and somehow this solved the problem:

    javac -classpath "C:\Documents and Settings\x\Desktop\eclipse\x\Program\extres\junit.jar" src\data\Program.java
    

    BTW:

    When I’m in C:\Documents and Settings\x\Desktop\eclipse\x\Program\ it also works with:

    javac -classpath extres\junit.jar src\data\Program.java
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know how can I replace this 2 symbol below from the string
Can I run this in a Windows command prompt like I can run it
Can someone guide me on a possible solution? I don't want to use /bin/cp
can someone explain why the compiler accepts only this code template<typename L, size_t offset,
I want use html5's new tag to play a wav file (currently only supported
Can anyone (maybe an XSL-fan?) help me find any advantages with handling presentation of
Can a LINQ enabled app run on a machine that only has the .NET
Can anyone help me trying to find out why this doesn't work. The brushes
can someone show me the regex for this preg_match. I want to make sure
can any one tell me how can change this java code into objective c.is

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.