[問題] 執行rmic時找不到class檔
現在的問題是 我在練習寫RMI 找了幾個網路上的簡單範例
但是都無法生成 stub 與 skeleton 這兩個檔案
我的步驟是
將如下的兩個檔案 編譯過 也就是執行下列兩個指令
javac MyRemote.java
javac MyRemoteImpl.java MyRemote.java
接著要執行 rmic MyRemoteImpl
它說有error: Class MyRemoteImpl not found.
請問是哪裡有問題 我都是照個網路上的範例做
不知道是哪個步驟出了差錯
檔案如下
===================================
import java.rmi.*;
public interface MyRemote extends Remote{
public String sayHello() throws RemoteException;
}
===================================
import java.rmi.*;
import java.rmi.server.*;
public class MyRemoteImpl extends UnicastRemoteObject implements MyRemote{
public MyRemoteImpl() throws RemoteException{
}
public String sayHello(){
return "Server says, 'Hey'";
}
public static void main(String[] args) {
try{
MyRemote service = new MyRemoteImpl();
Naming.rebind("RemoteHello", service);
System.out.println("RMI Server start...");
}catch(Exception ex){
ex.printStackTrace();
}
}
}
===============================
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.122.184.102
→
08/18 13:42, , 1F
08/18 13:42, 1F