Solved

java's problems

Posted on 2002-04-16
9
272 Views
Last Modified: 2013-11-23
i am now using the SAMS-Teach yourself Java2 in 21 days,but
faced some problems and needed for your help!

firstly,i used jdk1.2.2 version.According to the book,after installing
we might notice that one files installed in the JDK\lib subfolder
called classes.zip,but i cant find it.I used (Statr|Find|Files and folder)
to search the whole directory C: which i installed but the result was same.

second,i followed the book to set the path and type java -version and the
following displayed :"
java version 1.2.2
Classic VM (build JDK-1.2.2-W,native threads,symcjit)"

After that, i compiled the source files  in the book--HelloDan.java
successfully!A files called HelloDan.class is found in the same folder that
contains HelloDan.java. But,when i run it,the following error displayed:
'Exception in thread "main"java.lang.NoClassDefFoundError:HelloDan'
and i even followed the book to set the classpath,the same thing happenned.
so ,what should i do?Is there anyway to rectify this problems?

**I am using Windows98,Pentium MMX 200 **
0
Comment
Question by:tmchuan
9 Comments
 
LVL 19

Accepted Solution

by:
cheekycj earned 50 total points
Comment Utility
are you running the file using:
java HelloDan

not java HelloDan.class

about the classes.zip:
"With the Java 2 platform, the system classes no longer reside in a zip file (a good idea, considering occasional misguided attempts at unzipping the file). They're now stored in a Java Archive (jar) file. The runtime classes are found in the file rt.jar (located in the jre/lib directory), while the JDK-supported tool classes are found in the tools.jar file (located in the lib directory)." from javasoft.com

CJ
0
 
LVL 19

Expert Comment

by:cheekycj
Comment Utility
0
 

Expert Comment

by:mrowka
Comment Utility
try running the java interpreter with the -cp option
including the current directory (assuming you just
compiled it there)
such as:

java -cp . HelloDan

this should pick up the class files from the current directory
0
 
LVL 3

Expert Comment

by:rjackman
Comment Utility
check ur CLASSPATH
place . in it
ie
CLASSPATH = .;
cheers
RJ
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 

Author Comment

by:tmchuan
Comment Utility
Thanks a lots...good luck
0
 

Author Comment

by:tmchuan
Comment Utility
Thanks a lots...good luck
0
 

Author Comment

by:tmchuan
Comment Utility
Thanks to mrowka and rjackman ....
0
 

Author Comment

by:tmchuan
Comment Utility
Thanks to mrowka and rjackman ....
0
 
LVL 19

Expert Comment

by:cheekycj
Comment Utility
Thanx for the "A"
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
powerN  challenge 3 47
noX challenge 17 76
JAVA part two 5 39
bitbucket vs gitbucket 3 29
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now