can't find class name/class

I know there is a question with same subject but the solution
doesn't work in my case.

I have jdk ver 1.1.6 and installed in PC with Win98 2nd edition.
I able to compile source file to  But,
java, always give this error message : can't find
class name/class.

Pls help me solve this problem.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

will create myClass.class

java myClass

will execute that class
  While compiling you have to give
   and while running the program you have to give
java name,
   not java
The other thing is,in the program suppose you have a class with different name like this:
class hello
public static void main(String []args)
  In this case compile the program with
javac which will create hello.class.And if u want to run the program give java hello,it will work out.
   But the above case wont work if i am declaring the class hello as public since public class should be decalared in the file which should contain the same name.And ensure that CLASSPATH is set or not.
ylleeAuthor Commented:

there is a typing mistake, it should be java name.class & the error message is : can't find class name/class.

In fact, I'm in Java programming.  I simply follow the example in the book.  So, I'm not really understanding your answer.

Here, below is one of the sample :

class Root {
         public static void main(String[] arguments) {
                 int number = 225;
                 System.out.println("The square root of "
                         + number
                         + " is "
                         + Math.sqrt(number) );

I save it as  After javac, root.class created.
According the book, output is : The square root of 225 is 15.0.
But, error message of java root : can't find class root ; error message of java root.class : can't find class root/class.

Here is my autoexec.bat for your reference :

SET BLASTER=A220 I5 D1 H5 P330  T6
C:\TVLITE\chgport 2DC

PATH C:\jdk11\bin;


Please let me know where goes wrong?

Thank you very very much.
  better give,
   set CLASSPATH=.;c:\jdk1.1.6\lib\;
   in the autoexec.bat file and save it and run the autoexec.bat file.
  And check whether the .class file is available in the same directory which you working currently.
   Now try
    java root
   Still it is not working,then try
java -classpath c:\temp root
  assume that you are working temp directory which contains the root.class file.Now it will work.The option
-classpath allows us to specify where to find class for JVM.
   I think this will work out.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.