当前位置: 技术问答>java相关
Rmi问题,急死了(rmic RmiTestServer时,显示找不到类 RmiTestServer.class)
来源: 互联网 发布时间:2015-07-22
本文导语: import java.rmi.Remote; import java.rmi.RemoteException; public interface RemoteInterface extends Remote{ String message(String message)throws RemoteException; } 服务器 import java.rmi.Naming; import java.rmi.server.UnicastRemoteObject; import java.rmi.RemoteException...
import java.rmi.Remote;
import java.rmi.RemoteException;
public interface RemoteInterface extends Remote{
String message(String message)throws RemoteException;
}
服务器
import java.rmi.Naming;
import java.rmi.server.UnicastRemoteObject;
import java.rmi.RemoteException;
import java.rmi.RMISecurityManager;
public class RemoteObject extends UnicastRemoteObject implements RemoteInterface{
String name;
public RemoteObject(String name) throws RemoteException{
super();
this.name=name;
}
public String message(String message) throws RemoteException{
String returnString = name+message;
System.out.println(returnString);
return returnString;
}
public static void main(String args[]){
try{
String myName = "servertext";
RemoteObject theserver = new RemoteObject(myName);
Naming.rebind(myName,theserver);
System.out.println("ksdkfksd");
}
catch(Exception e){
System.out.println(e);
}
}
}
jdk1.3下
c:/xml/javac -g RmiTest.java
编译成功
c:/xml/javac -g RmiTestServer.java
出现以下错误:
RmiTestServer.java:16: cannot resolve symbol
symbol :class RmiTest
location :class xml.RmiTestServer
public class RmiTestServer extends UnicastRemoteObject implements RmiTest(
1 error
builder4中
但是,在jbuilder4中RmiTest.java与RmiTestServer.java都编译成功
rmic RmiTestServer
时显示
找不到类 RmiTestServer.class
import java.rmi.RemoteException;
public interface RemoteInterface extends Remote{
String message(String message)throws RemoteException;
}
服务器
import java.rmi.Naming;
import java.rmi.server.UnicastRemoteObject;
import java.rmi.RemoteException;
import java.rmi.RMISecurityManager;
public class RemoteObject extends UnicastRemoteObject implements RemoteInterface{
String name;
public RemoteObject(String name) throws RemoteException{
super();
this.name=name;
}
public String message(String message) throws RemoteException{
String returnString = name+message;
System.out.println(returnString);
return returnString;
}
public static void main(String args[]){
try{
String myName = "servertext";
RemoteObject theserver = new RemoteObject(myName);
Naming.rebind(myName,theserver);
System.out.println("ksdkfksd");
}
catch(Exception e){
System.out.println(e);
}
}
}
jdk1.3下
c:/xml/javac -g RmiTest.java
编译成功
c:/xml/javac -g RmiTestServer.java
出现以下错误:
RmiTestServer.java:16: cannot resolve symbol
symbol :class RmiTest
location :class xml.RmiTestServer
public class RmiTestServer extends UnicastRemoteObject implements RmiTest(
1 error
builder4中
但是,在jbuilder4中RmiTest.java与RmiTestServer.java都编译成功
rmic RmiTestServer
时显示
找不到类 RmiTestServer.class
|
发了。。
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。