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

[2985 byte] By [badpersona] at [2007-11-27 6:22:59]
# 1

> Both classes have a

> package com.jasonwardenburg.test;

> statement.

> The MathTester class (below) does not compile.

You folder structure does not match your packages. com.jasonwardenburg.test should be placed in

c:\jason\java\com\jasonwardenburg\test

Kaj

kajbja at 2007-7-12 17:40:26 > top of Java-index,Java Essentials,New To Java...
# 2
not sure I understand....and I realize I made a mistake, I'm at work and running this off my local f:\drive, so the folder structure is f:\jason\java\com\jasonwardenburg\testis that not correct?
badpersona at 2007-7-12 17:40:26 > top of Java-index,Java Essentials,New To Java...
# 3

> not sure I understand....

>

> and I realize I made a mistake, I'm at work and

> running this off my local f:\drive, so the folder

> structure is f:\jason\java\com\jasonwardenburg\test

>

> is that not correct?

Sorry, I didn't see the line that followed after your first directory description :)

kajbja at 2007-7-12 17:40:26 > top of Java-index,Java Essentials,New To Java...
# 4
How do you compile? I what directory are you when you compile?Kaj
kajbja at 2007-7-12 17:40:26 > top of Java-index,Java Essentials,New To Java...
# 5
was just reading through one of my books and if I use the -d option compling that seems to work. thanks, jason
badpersona at 2007-7-12 17:40:26 > top of Java-index,Java Essentials,New To Java...