What's wrong with it?

Hello everyone! I hava a question:

I have make programe and import two classes(which is in E:\mypackage\test\)

generated by myself,

when my envirenment aguments is:

JAVA-HOME:C:\jdk1.6.0

path:.;C:\jdk1.6.0\bin

classpath:.;C:\jdk1.6.0\lib;E:\mypackage

these happens:

E:\mydsn\code>javac GuessNumber.java

GuessNumber.java:8: can't access GenNumber

wrong class fole丗 .\GenNumber.java

file doesn't contains class GenNumber

please delete the file or make sure it is in a right sub-director of classpath.

GenNumber random1=new GenNumber();

^

1 error

but when my envirenment aguments is:

JAVA-HOME:C:\jdk1.6.0

path:.;C:\jdk1.6.0\bin

classpath:C:\jdk1.6.0\lib;E:\mypackage

it can pass compile,but when I run it:

the follows happens:

E:\mydsn\code>java GuessNumber

Exception in thread "main" java.lang.NoClassDefFoundError: GuessNumber

help me please! Thank you!

[1024 byte] By [Jfana] at [2007-10-3 4:08:48]
# 1

Tell us fully qualified class names of your classes and directory structue in which they are stored. And, where is your current directory from which you issue java command?

> classpath: C:\jdk1.6.0\lib;E:\mypackage

should be:

CLASSPATH=.;E:\mypackage

E:\mypackage should be your package root, not the directory where your packaged classes are stored.

hiwaa at 2007-7-14 22:08:41 > top of Java-index,Java Essentials,Java Programming...
# 2
crosspost http://forum.java.sun.com/thread.jspa?threadID=765328
kilyasa at 2007-7-14 22:08:41 > top of Java-index,Java Essentials,Java Programming...
# 3
In the two classes I make this statament: " package guess;" in class GussNumber,I use "import guess.*;"
Jfana at 2007-7-14 22:08:41 > top of Java-index,Java Essentials,Java Programming...
# 4

> In the two classes I make this statament: " package

> guess;"

> in class GussNumber,I use "import guess.*;"

Then your E:\mypackage or current directory is not the package root of the package 'guess'.

Above is assuming that your class path designate '.' and E:\mypackage.

Please give a FULL answer to my previous reply.

hiwaa at 2007-7-14 22:08:41 > top of Java-index,Java Essentials,Java Programming...