Crystal
Crystal

Reputation: 29448

Java classpath, class not found

I'm trying to be able to do homework on my work computer for a Java class. I see an old jdk is installed and I created a .bat to have my environment variables set up. I can do a simple "HelloWord" example, but now when I try to do a simple example where I create a FileOutputStream object, I get class not found on my FileOutputStream. Is this because my classpath is not set up, or because it can't find the io Package? Thanks.

Edit:

Here is my work directory structure:
C:\dmd\jdk1.3.1
within jdk1.3.1 ->
bin
jre
lib
src (my files)

in my bin folder, i have this .bat file:
@echo off
SET TOOLS_HOME=c:\DMD
SET JAVA_HOME=%TOOLS_HOME%\jdk1.3.1
SET PATH=%JAVA_HOME%\BIN;%PATH%
SET CLASSPATH=.;

Upvotes: 0

Views: 1140

Answers (2)

pauljwilliams
pauljwilliams

Reputation: 19225

Both - it cant find the IO package because your classpath isnt set up correctly. Do you have JAVA_HOME set correctly?

Upvotes: 0

Tom Tresansky
Tom Tresansky

Reputation: 19892

Do you have an import java.io statement in your source file using the FileOutputStream?

Upvotes: 1

Related Questions