views:

34

answers:

2

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=.;
+1  A: 

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

Tom Tresansky
That would be `import java.io.*`, right?
Carl Smotricz
Or import java.io.FileOutputStream. I thought mentioning you need to import from java.io might be a more general way of saying that both are acceptable.
Tom Tresansky
Both exactly right. +1.
Carl Smotricz
Yes, the import java.io.* is there.
Crystal
A: 

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

Visage
We don't know just how old this Java installation is, but since version 1.3 Java doesn't need or respect JAVA_HOME any more.
Carl Smotricz