0

everyone! I am trying to work on a simple program that takes a command-line argument, and passes it as a parameter to a function from a Text.class file that our professor instructed us to download, and place in the working directory. I placed it in the same folder that contained the .java file. I think that is where I went wrong, could someone please offer me some assistance? Thank you :)

----jGRASP exec: javac -g /home/seedl/Documents/School/CSx/Programming Assignments/#1/SpeedPrinter/src/speedprinter/SpeedPrinter.java
SpeedPrinter.java:14: error: cannot find symbol
        Text.toNonnegativeDouble(args[0]);
        ^
  symbol:   variable Text
  location: class SpeedPrinter
1 error

 ----jGRASP wedge: exit code for process is 1.
 ----jGRASP: operation complete.
4

1 回答 1

1

您必须将 Text.class 添加到您的类路径中。如果您从命令行运行,请使用 java -cp %path_to_Text.class%。如果您从 IDE 运行,则可以将文件夹添加到类路径中,以便它们可以包含在您的程序中,

于 2013-01-19T07:39:09.250 回答