I'm trying to go through the course/textbook described at the link below, which uses the libraries at the link below. I am trying to write a little test program, which uses the stdout.java
and stdin.java
libraries.
I am using the windows terminal window with the java development kit
.
So i have a program, test.java
, which calls stdin.java
.
I have test.java
, stdin.java
and stdout.java
in the same directory. I type in javac stout.java
and I get no error messages, but when I type in javac stdin.java
I get
error: cannot find symbol StdOut.println();
and If I haven't turned stdin.java
into a class file (using javac stdin.java) I can run test.java
The problem is that your complied StdOut
class is not in the class path . There are a couple of ways you can resolved this.
-cp
option.So for example, you could run the following to compile StdOut and then compile StdIn (assuming you class files are all in the same directory):
javac StdOut.java
javac -cp * StdIn.java
Here is more information on Setting the class path
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.