低
低调一贱男
Unregistered / Unconfirmed
GUEST, unregistred user!
//package的源代码
package c05.dessert;
public class Cookie {
public Cookie() {
System.out.println("Cookie constructor");
}
void bite() { System.out.println("bite");
}
} ///:~
//引用的源代码
import c05.dessert.*;
public class Dinner {
public Dinner() {
System.out.println("Dinner constructor");
}
public static void main(String[] args) {
Cookie x = new Cookie();
//! x.bite();
// Can't access
}
} ///:~
//我已经设置了系统环境变量
classpath=.;%JAVA_HOME%/lib;J:/java source/source/cake;J:/java source/code/c05/dessert;J:/java source/code
其中 J:/java source/code/c05/dessert 下面就包含了Cookie.class文件
但是在编译的时候出错,提示如下:
--------------------Configuration: JDK version 1.3.1 <Default>--------------------
J:/java source/code/c05/Dinner.java:5: package c05.dessertdo
es not exist
import c05.dessert.*;
^
J:/java source/code/c05/Dinner.java:12: cannot resolve symbol
symbol : class Cookie
location: class Dinner
Cookie x = new Cookie();
^
J:/java source/code/c05/Dinner.java:12: cannot resolve symbol
symbol : class Cookie
location: class Dinner
Cookie x = new Cookie();
^
3 errors
Process completed.
package c05.dessert;
public class Cookie {
public Cookie() {
System.out.println("Cookie constructor");
}
void bite() { System.out.println("bite");
}
} ///:~
//引用的源代码
import c05.dessert.*;
public class Dinner {
public Dinner() {
System.out.println("Dinner constructor");
}
public static void main(String[] args) {
Cookie x = new Cookie();
//! x.bite();
// Can't access
}
} ///:~
//我已经设置了系统环境变量
classpath=.;%JAVA_HOME%/lib;J:/java source/source/cake;J:/java source/code/c05/dessert;J:/java source/code
其中 J:/java source/code/c05/dessert 下面就包含了Cookie.class文件
但是在编译的时候出错,提示如下:
--------------------Configuration: JDK version 1.3.1 <Default>--------------------
J:/java source/code/c05/Dinner.java:5: package c05.dessertdo
es not exist
import c05.dessert.*;
^
J:/java source/code/c05/Dinner.java:12: cannot resolve symbol
symbol : class Cookie
location: class Dinner
Cookie x = new Cookie();
^
J:/java source/code/c05/Dinner.java:12: cannot resolve symbol
symbol : class Cookie
location: class Dinner
Cookie x = new Cookie();
^
3 errors
Process completed.