• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 313
  • Last Modified:

Problem Compiling doing a compile after a long time

Hi All:

I used java a number of years back and doing a compile after a long time. I am having the following problem.
I try and compile a program I get the following problem:

admin1.java:1: package com.meterware.httpunit does not exist
import com.meterware.httpunit.*;
^
admin1.java:2: package junit.framework does not exist
import junit.framework.*;
^
admin1.java:3: package junit does not exist
import junit.*;
^
admin1.java:13: cannot resolve symbol
symbol  : class TestCase

I have added library for httpunit but not for junit yet.  I have added httpunit.jar file path to my CLASSPATH.
Please let me know  how to get rid of these compile errors.

Regards

-sunnybrad
0
sunnybrad
Asked:
sunnybrad
  • 4
  • 2
2 Solutions
 
objectsCommented:
Add the required jars to uyou jdk's 'ext' directory.
0
 
aozarovCommented:
httpunit requires junit.jar which an be downloaded from http://prdownloads.sourceforge.net/junit/junit3.8.1.zip?download
Add it to your classespath
0
 
objectsCommented:
It'll be something like:

C:\j2sdk1.4.2_06\jre\lib\ext
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
objectsCommented:
Adding jar's to your ext directory avoids having to add them to your classpath.
0
 
sunnybradAuthor Commented:
Thanks for all the comments from experts I will try things out.

-sunnybrad
0
 
aozarovCommented:
You need the junit.jar in anycase.
Personally I prefer to keep the JDK extension folder clean (unless it provides a huge advantage for my needs).
Putting stuff there might cause problems when that framework is using dynamic class loading (which Junit framework does for sure).
For more info about that look at http://www.neward.net/ted/Papers/ClassForName/index.html 
I think you can go with what you did before and just add the needed libraries (junit.jar in this case) to your CLASSPATH
0
 
objectsCommented:
:)
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now