Package not found error

Discussion in 'Java' started by sjoshi, Sep 2, 2005.

  1. sjoshi

    sjoshi Guest

    Hello
    When try to run my simple build.xml, I get these errors:

    [javac] D:\Sunit\JavaFiles\workspace\Ch2\src\org\sj\Ch2_01Test.java:9:
    package junit.framework does not exist
    [javac] import junit.framework.TestCase;
    [javac] D:\Sunit\JavaFiles\workspace\Ch2\src\org\sj\Ch2_01Test.java:17:
    cannot resolve symbol
    [javac] symbol : class TestCase
    [javac] location: class org.sj.Ch2_01Test
    [javac] public class Ch2_01Test extends TestCase

    Now I can run the Ch2_01Test file within eclipse and it goes thru.
    fine. Under my project's properties, I have in the Order And Export tab
    listed
    Ch2/src - Checked
    JRE System Library 1.4.2 - Unchecked
    [JUNIT_HOME]/juint.jar - path to the jar file - I Checked this one

    Under Libraries tab
    I have both JUNIT_HOME and SRE System Library

    Any ideas what might be wrong that Ant complains. I'm in Eclipse 3.1

    thanks
    Sunit
     
    sjoshi, Sep 2, 2005
    #1
    1. Advertisements

  2. [JUNIT_HOME]/juint.jar ?
    [JUNIT_HOME]/junit.jar
     
    Andrew Thompson, Sep 2, 2005
    #2
    1. Advertisements

  3. sjoshi

    Roedy Green Guest

    you must find out the jar where junit.framework.TestCase lives

    Then put that jar on the project classpath or in the ext directories
    of your JREs.

    see http://mindprod.com/jgloss/classpath.html
     
    Roedy Green, Sep 3, 2005
    #3
  4. sjoshi

    Roedy Green Guest

    Can you dump Ant's view of the classpath? Perhaps ticking that box is
    not sufficient to inform ant about the junit jar.

    Have you in some way told Eclipse you are going to generate your own
    ant script and therefore Eclipse is no longer meddling with it, namely
    adding the junit jar to the classpath.

    If you can turn on the -verbose option both in ant and in javac, it
    might give you a clue as to what is going on.
     
    Roedy Green, Sep 3, 2005
    #4
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.