简体   繁体   中英

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=.;

使用FileOutputStream在源文件中是否有import java.io语句?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM