请问,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();
}
}
这两个文件能直接编译吗?是不是包路径有问题?

解决方案 »

  1.   

    对了,它下面显示的是:
    --------------------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.
      

  2.   

    你要先把这个包导到你的工程里。
    编译命令在 【bulid】,【compile file】
      

  3.   

    谢谢二楼的高手,我是在Jcreator里面创建的.为什么运行时会出现:
    --------------------Configuration:   SecondProj   -   JDK   version   1.6.0_03   <Default>   -   <Default> -------------------- 
    错误:仅当显式请求注释处理时才接受类名称“org.it315.secondproj.SencondDemo” 
    1   错误 Process   completed. 
    但是我的包路径,感觉没有错啊!!
      

  4.   

    呵呵,对不起.我知道我错哪!!
    是我的JDK的运行命令不对]
    谢谢咯