This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

package junit.framework does not exist

 
Stephen Spiteri
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Im new to junit and javaranch actually, could anyone help me out??

Ive tried installing junit by unzipping it to c:\junit3.8.1\ and set the environment

set classpath=%classpath%;C:\junit3.8.1\junit.jar

(which to the best of my knowledge is right... but when trying to compile a java file i get:

C:\Antbook\ch06\test>javac org\example\antbook\junit\SimpleTest.java
org\example\antbook\junit\SimpleTest.java:3: package junit.framework does not exist
import junit.framework.TestCase;
^
org\example\antbook\junit\SimpleTest.java:5: cannot resolve symbol
symbol : class TestCase
location: class org.example.antbook.junit.SimpleTest
public class SimpleTest extends TestCase
^
org\example\antbook\junit\SimpleTest.java:13: cannot resolve symbol
symbol : method assertTrue (boolean)
location: class org.example.antbook.junit.SimpleTest
assertTrue(4 == (2 * 2));
^
3 errors

What have i done wrong??

Thanks
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How are you compiling your code? Are you using some sort of a batch script? If you are, could you post it for us to see?
 
Stephen Spiteri
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
im just doing javac to compile it,

the code for the java file is:


Its the import bit that goes wrong, so i have a feeling its the installation of junit thats the problem.
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does it compile if you do this?
javac -classpath %CLASSPATH%;C:\junit3.8.1\junit.jar org\example\antbook\junit\SimpleTest.java
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic