0

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=.;
3
  • Give us a chance! Show us your .bat and/or your Java code. We're not telepaths! Commented Jul 28, 2010 at 16:29
  • mumble, java.io.FileOutputStream is part of java language since 1.0. I do not think that your jdk is older than that. Commented Jul 28, 2010 at 16:36
  • 1
    PATH looks good, JAVA_HOME is irrelevant, that means it's probably in the coding, as Tom Tresansky hints. Commented Jul 28, 2010 at 16:36

2 Answers 2

1

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

Sign up to request clarification or add additional context in comments.

2 Comments

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.
Yes, the import java.io.* is there.
0

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

1 Comment

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.