RMI - 使用 rmic 创建存根
我一直在为简单的 RMI 实现创建存根。使用命令行,我位于存储类文件的目录中。
对我来说它是: C:\Users\John\Documents\NetBeansProjects\testServer\build\classes\RMI
RMI 这是我的文件所在的包。现在,当我在这个文件夹中时,我尝试使用 rmic 制作存根 - v1.2 -keep CountingOnServer,但命令行写我,找不到该类 CountingOnServer。不管我在做什么,仍然写出这样一个令人难以置信的错误......你知道如何解决这个问题吗?
谢谢
I am stuck with creating stubs for my simple RMI implementation. With command line, I am at directory, where I have my class files stored.
For me it is: C:\Users\John\Documents\NetBeansProjects\testServer\build\classes\RMI
RMI here is the package I have my files in. Now when I am in this folder, I tri to make stubs with rmic -v1.2 -keep CountingOnServer, but command line writes me, that class CountingOnServer not found. No matter what I am doing, still it is writing such a unbelivable mistake... do you know how to solve that?
Thx
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
据猜测,问题在于
CountingOnServer
位于某个包内,因此您应该使用全名,例如RMI.CountingOnServer
。不要忘记从类路径根运行 rmic,在您的情况下,该根似乎是build\classes
目录。As a guess, issue is that
CountingOnServer
is inside some package, so you should use full name likeRMI.CountingOnServer
. Don't forget to run rmic from the the class-path root which in your case seems to bebuild\classes
directory.如果您在包中实现了 RMI,则在类文件的根目录下运行 rmic,
例如,
我的类位于 build/classes/com/rmi 目录中,因此,要创建存根,我可以在根目录下运行 rmic,如
../build/classes/rmic com.rmi.Hello
If you have your RMI implementation in packages run rmic at the root of your class files,
ex,
I have my classes in build/classes/com/rmi directory so, to create stubs I can run rmic at the root as,
../build/classes/rmic com.rmi.Hello