为了实现rmi,修改java.rmi.server.codebase出错
为了实现rmi分布式系统, 需要修改codebase为我的服务器地址,
现我尝试将codebase的地址改为我电脑上apache服务器的根目录,但是老是出错,实在不知道为什么
我的电脑系统是win7
下面是错误代码:
C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs>java -D java.
rmi.server.codebase=http://localhost:8080/
Exception in thread "main"
java.lang.NoClassDefFoundError: java/rmi/server/codeb
ase=http://localhost:8080/
Caused by: java.lang.ClassNotFoundException: java.rmi.server.codebase=http:..loc
alhost:8080.
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: java.rmi.server.codebase=http://localhost:8080/.
Program will exit.
C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs>
------解决方案--------------------
建目录了么