Reputation: 41
Well i decided to create RMI but faced with one problem. i put CLASSPATH= (to my jdk) then i decided to make Stub with rmic. I wrote: 1. rmic -classpath "D:\workspace\Rmi.example\bin\rmi\app" AddServer -d D:\workspace
where i got such message: error: File D:\workspace\Rmi.example\bin\rmi\app\AddServer.class does not contai n type AddServer as expected, but type rmi.app.AddServer. Please remove the file , or make sure it appears in the correct subdirectory of the class path. error: Class AddServer not found. 2 errors
Upvotes: 0
Views: 3143
Reputation: 311028
rmic -classpath "D:\workspace\Rmi.example\bin" rmi.app.AddServer -d D:\workspace
BUT: Don't use 'rmic' at all. It hasn't been required for about ten years. Read the preamble to UnicastRemoteObject. Basically, as long as you provide a port number when constructing/exporting your remote objects, even zero, a dynamic stub can be generated instead at runtime.
Upvotes: 1
Reputation: 1988
You're supposed to run rmic from the base directory where your package starts. For example: rmic -classpath "D:\workspace\Rmi.example\bin\" rmi.app.AddServer -d D:\workspace
Upvotes: 0
Reputation: 76
I understand your class AppServer is in rmi.app package? Then your classpath must be D:\workspace\Rmi.example\bin, not D:\workspace\Rmi.example\bin\rmi\app
Upvotes: 0