Solved

java class can not be found

Posted on 1998-11-18
2
186 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
firstChar challenge 13 107
Running Jira on Raspberry PI 2? 3 255
java.io.BufferedReader   readLine()  //returns the entire file ? 4 59
Java DateChooser? 3 29
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…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
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…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

911 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

20 Experts available now in Live!

Get 1:1 Help Now