Solved

java class can not be found

Posted on 1998-11-18
2
176 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
Comment Utility
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
Comment Utility
That a very clear answer. Thanks!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
scoreUp challenge 14 47
pairstar challenge 2 41
countHi2 challenge 7 43
What is the latest versions eclipse neon 2 116
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…
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…
This video teaches viewers about errors in exception handling.

771 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

11 Experts available now in Live!

Get 1:1 Help Now