package question
I've been doing some simple exercises, and for these I wanted to use the command line and not eclipse, and I'm getting a little bit of a rude awakening in terms of some underlying stuff that I need to know.
I have my classpath set to c:\jason\java;.; (to include current working directory)
I have the following folders under c:\jason\java:
com\jasonwardenburg\test
in the test folder I have two java files, NumOps.java and MathTester.java
The NumOps is a class with no main method, getters and setters, and a couple of methods; one to check for prime numbers, one to return prime factorials. This class compiles with no problem.
Both classes have a
package com.jasonwardenburg.test;
statement.
The MathTester class (below) does not compile.
package com.jasonwardenburg.test;
import javax.swing.JOptionPane;
publicclass MathTester{
publicstaticvoid main(String[] args){
MathTester test1 =new MathTester();
test1.go();
}
publicvoid go(){
System.out.println("starting main method of MathTester class:");
String input=JOptionPane.showInputDialog("please enter a whole number: ");
int number = Integer.parseInt(input);
NumOps ops1 =new NumOps(number);
ops1.getPrimeFactorial(number);
System.out.println("done with main method of MathTester class:");
System.exit(0);
}
}
It gives me this error when compiling:
F:\jason\java\com\jasonwardenburg\test>javac MathTester.java
MathTester.java:22: cannot find symbol
symbol :class NumOps
location:class com.jasonwardenburg.test.MathTester
NumOps ops1 =new NumOps(number);
^
MathTester.java:22: cannot find symbol
symbol :class NumOps
location:class com.jasonwardenburg.test.MathTester
NumOps ops1 =new NumOps(number);
^
2 errors
I tried placing an import staement, but still had a problem. Going through the books and tutorials, not seeing this addressed specifically.
thanks,
bp

