?
Solved

java class can not be found

Posted on 1998-11-18
2
Medium Priority
?
220 Views
Last Modified: 2010-03-30
I just download the sun JDK 1.02 version, and installed on my Win NT. I tried the first helloworld program. But when I run it, the program generates the message:"Can't find class HelloWorld".

Can somebody tell me what else I need to do to set up the environment right? Thanks.
0
Comment
Question by:haitao
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 16

Accepted Solution

by:
heyhey_ earned 600 total points
ID: 1227686
Probably you need only to include the current directory "." in the CLASSPATH
SET CLASSPATH=%CLASSPATH%;.
when java searches for class files it looks through the CLASSPATH enviroment variable
(this is analogue to PATH for .exe files). the "." points to the current directory so
java will check the current directory too - and find the Hello.class (suppose that you
start Hello from the same directory where it is positioned)

So does this work ?
0
 

Author Comment

by:haitao
ID: 1227687
That a very clear answer. Thanks!
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Suggested Courses
Course of the Month9 days, 15 hours left to enroll

762 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