the so-called "classpath" is the path where java vm find your application . for example: your application named "t.class " is in c:\java you must type "java -classpath c:\java t" or "java -cp c:\java t" or "java -cp . t" ......
在以上两位的帮助下,小弟大概明白是怎么回事了,我在用javac编译.java程序时,并没有自动生成.class文件,但编译并没有提示错误呀?程序如下: class bigDebt{ public static void main(String[] argument) { int debt=446000000; debt=debt/1440; System.out.println("A minutes's worth of debt is $" + debt); } } 请问各位:为什么编译后没有生成.class 文件?用javac编译生成的.class文件能指定文件名吗?
for example:
your application named "t.class " is in c:\java
you must type "java -classpath c:\java t" or "java -cp c:\java t" or
"java -cp . t" ......
class bigDebt{
public static void main(String[] argument) {
int debt=446000000;
debt=debt/1440;
System.out.println("A minutes's worth of debt is $" + debt);
}
}
请问各位:为什么编译后没有生成.class 文件?用javac编译生成的.class文件能指定文件名吗?
class bigDebt{
public static void main(String[] argument) {
int debt=446000000;
debt=debt/1440;
System.out.println("A minutes's worth of debt is $" + debt);
}
}
我没有把它存成bigDebt.java,而是把它存成了test.java,但编译时生成的是bigDebt.class,也就没有test.class文件了。
谢谢各位。
同时也希望一些初学编程的朋友,不要象我这样粗心大意。