Solved

java class can not be found

Posted on 1998-11-18
2
196 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
2 Comments
 
LVL 16

Accepted Solution

by:
heyhey_ earned 150 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
stackato and cloud 4 85
netstat -ano | find "8000" and taskkill /f /pid 2984 3 56
javap bin 2 34
jsp insert to database example 2 23
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

770 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