哟,我正在尝试编译一个文件,它不会编译。
我试过改变路径,但我的路径似乎是正确的。javac 工作正常。
public class BeerSong{
public static void main(String[] args){
int beerNum = 99;
String word = "bottles";
while (beerNum >0){
if(beerNum == 1){
word = "bottle";
}
System.out.println(beerNum+" "+word+" of beer on the wall!");
System.out.println(beerNum + " of beer.");
System.out.println("Take one down.");
System.out.println("Pass it around.");
beerNum = beerNum-1;
if(beerNum>0){
System.out.println(beerNum+" "+word+" of beer on the wall!");
}else{
System.out.println("No more bottels of beer on the wall.");
}
}
}
}
该文件保存为 BeerSong.java
在命令提示符中转到正确的目录并键入“javac BeerSong.java”后,我收到此错误:
BeerSong.java:1: error: error while writing BeerSong: BeerSong.class
(The system cannot find the file specified) public class BeerSong{
^ 1 error
梵蒂冈之花
相关分类