Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

rmic  RSS feed

 
Reilly Morris
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
I am trying to rmic a class in dos and keep getting "Bad command or file name" as a return. I am trying this syntax:
C:\jdk1.3\bin rmic AccountImpl
and it is not working. Any suggestions out there? If it is a CLASSPATH issue, maybe some advice on how to add this to CLASSPATH in windows 98. I have never modified CLASSPATH and don't know how to do that.
Any help would be great... I really want to see this RMI in action!
Thanks,
Reilly Morris
 
Reilly Morris
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I should add that I have installed all the J2EE executables in the bin folder from another source. When I tried to download them from Sun, they require Windows NT or 2000, and so I got the executables from another soure and simply added them to my bin. I can start the rmiregistry no problem, so I think it will work anyway. Can't really go and put another OS on just to try RMI
Reilly
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If that command line string you show is exactly what you put in, then it won't run because the system thinks the command is "bin," not rmic.
------------------
Michael Ernest, co-author of: The Complete Java 2 Certification Study Guide
 
Reilly Morris
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Great! You were right. That was an easy one. Now, I compile the first file normally as an interface with empty method bodies. The next class I create implements the first... and even though they are in the exact same directory, the compiler is throwing out that it "Cannot Resolve Symbol", referencing the interface I just compiled. Here is the code:
>>>>>>>>>First the interface>>>>>>>>>>>>>>>>>
import java.rmi.Remote;
import java.rmi.RemoteException;
public interface Account extends Remote
{
public String getName() throws RemoteException;
}
>>>>>>>>Now the implementing class>>>>>>>>>>>>>>>
import java.rmi.server.UnicastRemoteObject;
import java.rmi.RemoteException;
public class AccountImpl extends UnicastRemoteObject implements Account
{
private float mBalance = 0;
private String mName = "";

//Create a new account with the given name
public AccountImpl(String name) throws RemoteException
{
mName = name;
}

public String getName() throws RemoteException
{
return mName;
}
}
Any ideas on this one? As both are in the same directory, I can't get what the issue might be?
Reilly
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It could be your CLASSPATH is defined but doesn't include the current directory. You can try:

to see if that helps.
------------------
Michael Ernest, co-author of: The Complete Java 2 Certification Study Guide
 
Reilly Morris
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just took an online tutorial covering classpath... went into my Autoexec.bat and added the location of my rmi files to the classpath. You were right, it is now compiling no problem (both the Account and AccountImpl files). However when I now run this command:
c:\jdk1.3\bin\rmic AccountImpl
here is the error being thrown:
c:\jdk1.3\bin\rmic.exe
Working Directory - C:\Java\rmi
java.lang.NoClassDefFoundError: sun/tools/java/Constants
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:486)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:486)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
at java.lang.ClassLoader.loadClass(ClassLoader.java:290)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
Exception in thread "main" Process Exit...
In all it's glory. Any ideas? I have checked the directory and no stubs/skeletons were created. I really thought this would have been more simple, but I think it must be configuring my system that is so cumbersome, not the actual RMI content.
Reilly
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!