javac“找不到符号”错误与命令行
我有两个类拥有和拥有Accessor。这些文件位于同一目录中。
public class Owning {
String _name = "";
public void printBanner()
{
}
public void printOwning(double amount)
{
printBanner();
//print details
System.out.println("name:" + _name);
System.out.println("amount:" + amount);
}
}
public class OwningAccessor {
public void access()
{
Owning o = new Owning();
o.printOwning(500);
}
}
当我尝试使用 编译时,我收到编译错误。OwningAccessor
javac -cp . OwningAccessor.java
symbol : class Owning
location: class smcho.OwningAccessor
Owning o = new Owning();
^
OwningAccessor.java:6: cannot find symbol
symbol : class Owning
location: class smcho.OwningAccessor
Owning o = new Owning();
^
这是怎么回事?代码在 eclipse IDE 下编译良好。