当前位置: 技术问答>java相关
菜鸟一问:请问怎么启动线程?高手请指教
来源: 互联网 发布时间:2015-05-02
本文导语: 怎么我调用不了啊? public class EsasServer { public static void main(String[] args) { ClientEsas cs = new ClientEsas(); cs.start(); WaitForMsg wf = new WaitForMsg(); wf.start(); } } public class WaitForMsg extends Thread { ……...
怎么我调用不了啊?
public class EsasServer {
public static void main(String[] args) {
ClientEsas cs = new ClientEsas();
cs.start();
WaitForMsg wf = new WaitForMsg();
wf.start();
}
}
public class WaitForMsg extends Thread { …… }
public class ClientEsas extends Thread { …… }
系统报错:
EsasServer.java:5: cannot resolve symbol
symbol : class ClientEsas
location: class alpha.EsasServer
ClientEsas cs = new ClientEsas();
^
EsasServer.java:5: cannot resolve symbol
symbol : class ClientEsas
location: class alpha.EsasServer
ClientEsas cs = new ClientEsas();
^
EsasServer.java:7: cannot resolve symbol
symbol : class WaitForMsg
location: class alpha.EsasServer
WaitForMsg wf = new WaitForMsg();
^
EsasServer.java:7: cannot resolve symbol
symbol : class WaitForMsg
location: class alpha.EsasServer
WaitForMsg wf = new WaitForMsg();
怎么回事啊?
public class EsasServer {
public static void main(String[] args) {
ClientEsas cs = new ClientEsas();
cs.start();
WaitForMsg wf = new WaitForMsg();
wf.start();
}
}
public class WaitForMsg extends Thread { …… }
public class ClientEsas extends Thread { …… }
系统报错:
EsasServer.java:5: cannot resolve symbol
symbol : class ClientEsas
location: class alpha.EsasServer
ClientEsas cs = new ClientEsas();
^
EsasServer.java:5: cannot resolve symbol
symbol : class ClientEsas
location: class alpha.EsasServer
ClientEsas cs = new ClientEsas();
^
EsasServer.java:7: cannot resolve symbol
symbol : class WaitForMsg
location: class alpha.EsasServer
WaitForMsg wf = new WaitForMsg();
^
EsasServer.java:7: cannot resolve symbol
symbol : class WaitForMsg
location: class alpha.EsasServer
WaitForMsg wf = new WaitForMsg();
怎么回事啊?
|
肯定是CLASSPATH没有设置好
|
肯定类路径不对
试试 将这几个class放在同一目录下,
然后在classpath中加入此路径
试试 将这几个class放在同一目录下,
然后在classpath中加入此路径
|
查查你的类路径对不对
|
classpath没设好。