0

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

  • Then i got the problem:rmic -classpath "D:\workspace\Rmi.example\b in\rmi.app" AddServer -d D:\workspace error: Class AddServer not found. 1 error – Olexander Haliy Mar 22 '13 at 16:39

3 Answers3

1
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.

user207421
  • 305,947
  • 44
  • 307
  • 483
0

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

Greg Temkin
  • 76
  • 1
  • 3
0

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

gparyani
  • 1,958
  • 3
  • 26
  • 39