请问,Jcreator在运行前,需要编译吗?如果需要,编译是在哪?package org.it315.secondproj;
public class A {
/**
* Method sayHello
*
*
*/
public void sayHello() {
// TODO: Add your code here
System.out.println("www.it315.org");
}
}
package org.it315.secondproj;
public class SencondDemo {
public int x = 1;
/**
* Method main
*
*
* @param args
*
*/
public static void main(String[] args) {
// TODO: Add your code here
if(args.length>0)
{
System.out.println("the first Param is "+args[0]);
}
else
{
new SencondDemo().callA(new A());
}
} /**
* Method callA
*
*
* @param a
*
*/
public static void callA(A a) {
// TODO: Add your code here
a.sayHello();
}
}
这两个文件能直接编译吗?是不是包路径有问题?
public class A {
/**
* Method sayHello
*
*
*/
public void sayHello() {
// TODO: Add your code here
System.out.println("www.it315.org");
}
}
package org.it315.secondproj;
public class SencondDemo {
public int x = 1;
/**
* Method main
*
*
* @param args
*
*/
public static void main(String[] args) {
// TODO: Add your code here
if(args.length>0)
{
System.out.println("the first Param is "+args[0]);
}
else
{
new SencondDemo().callA(new A());
}
} /**
* Method callA
*
*
* @param a
*
*/
public static void callA(A a) {
// TODO: Add your code here
a.sayHello();
}
}
这两个文件能直接编译吗?是不是包路径有问题?
--------------------Configuration: SecondProj - JDK version 1.6.0_03 <Default> - <Default>--------------------
javac: 无效的标志: D:\study\Java
用法: javac <options> <source files>
-help 用于列出可能的选项Process completed.
和:
--------------------Configuration: SecondProj - JDK version 1.6.0_03 <Default> - <Default>--------------------
错误:仅当显式请求注释处理时才接受类名称“org.it315.secondproj.SencondDemo”
1 错误Process completed.
编译命令在 【bulid】,【compile file】
--------------------Configuration: SecondProj - JDK version 1.6.0_03 <Default> - <Default> --------------------
错误:仅当显式请求注释处理时才接受类名称“org.it315.secondproj.SencondDemo”
1 错误 Process completed.
但是我的包路径,感觉没有错啊!!
是我的JDK的运行命令不对]
谢谢咯