you need to include junit jar in your classpath
javac -Xlint -classpath junit.jar:. *.java
Main Topics
Browse All TopicsI have a set of classes and an associated set of test classes that Is successfully running on my laptop with eclipse.
Now I need to run these on a single core processor, which I must access through ssh on a terminal command line. Is there a javac option or a package to include or something to make this work on the command line?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
oh oh. does this mean some sysadmin work needs to be done?
kayve@netlab1 ~/HW4 $ cd test
kayve@netlab1 ~/HW4/test $ javac -Xlint -classpath junit.jar:. *.java
warning: [path] bad path element "junit.jar": no such file or directory
CoarseListTest.java:9: package junit.framework does not exist
import junit.framework.*;
There's no jar.. what about these other things?
kayve@netlab1 ~/HW4/test $ ls /usr/portage/dev-java/juni
ChangeLog files junit-3.8.2-r1.ebuild metadata.xml
Manifest junit-3.8.1-r3.ebuild junit-4.4-r1.ebuild
kayve@netlab1 ~/HW4/test $ ls /usr/portage/dev-java/juni
junit-3.8.2-build.xml
kayve@netlab1 ~/HW4/test $
you need the junit jar to be able to compile (and run) your tests
you can download it from http://www.junit.org/
^
LockFreeListTest.java:24: cannot find symbol
symbol : class LockFreeList
location: class lists.LockFreeListTest
instance = new LockFreeList<Integer>();
^
OptimisticListTest.java:24
symbol : class OptimisticList
location: class lists.OptimisticListTest
instance = new OptimisticList<Integer>();
^
10 errors
kayve@netlab1 ~/HW4/test $ grep LockFreeList ../src/*
Binary file ../src/LockFreeList$Node.c
Binary file ../src/LockFreeList$Window
Binary file ../src/LockFreeList.class matches
../src/LockFreeList.java: * LockFreeList.java
../src/LockFreeList.java:p
../src/LockFreeList.java: public LockFreeList() {
kayve@netlab1 ~/HW4/test $
> kayve@netlab1 ~/HW4/test $ java LazyListTest
> Exception in thread "main" java.lang.NoClassDefFoundE
looks like your test class is also in a package, so you need to specify the full name to run it (and include the classpath)
java -classpath ../junit-4.7.jar:../src:. lists.LazyListTest
if you don't have a main you need to use TestRunner
http://clarkware.com/artic
So I have to do this step first?
Step 3: Write a Test Suite
Next, we'll write a test suite that includes several test cases. The test suite will allow us to run all of its test cases in one fell swoop.
To write a test suite, follow these steps:
1.
Write a Java class that defines a static suite() factory method that creates a TestSuite containing all the tests.
2.
Optionally define a main() method that runs the TestSuite in batch mode.
The following is an example test suite:
import junit.framework.Test;
import junit.framework.TestSuite;
public class EcommerceTestSuite {
public static Test suite() {
TestSuite suite = new TestSuite();
//
// The ShoppingCartTest we created above.
//
suite.addTestSuite(Shoppin
//
// Another example test suite of tests.
//
suite.addTest(CreditCardTe
//
// Add more tests here
//
return suite;
}
/**
* Runs the test suite using the textual runner.
*/
public static void main(String[] args) {
junit.textui.TestRunner.ru
}
}
Business Accounts
Answer for Membership
by: kayveyPosted on 2009-11-04 at 11:00:16ID: 25742628
this is my laptop:
pace/HW4/t est/lists$ uname -a pace/HW4/t est/lists$
sftp> quit
kayve@kayve-laptop:~/works
Linux kayve-laptop 2.6.28-16-generic #55-Ubuntu SMP Tue Oct 20 19:48:24 UTC 2009 i686 GNU/Linux
kayve@kayve-laptop:~/works
this is the single core machine:
/home/kayve/HW4/test
kayve@netlab1 ~/HW4/test $ uname -a
Linux netlab1 2.6.25-gentoo-r7 #1 SMP Thu Aug 28 11:55:42 PDT 2008 i686 Intel(R) Celeron(R) CPU 2.60GHz GenuineIntel GNU/Linux
kayve@netlab1 ~/HW4/test $