• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

rmic Compilation error with JDk1.3

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I have JDK1.3 installed in Windows NT4.0 with Service Pack.
I am trying to compile a small RMI code I have three files in
d:\xml
1. IHelloRmi.java // This is the remote inteface.
2. HelloRmi.java // This is the implementation
3. HelloRmiClient.java // This is the client
All files have "package rmi" statement at top.
I compiled em succesfully. Now I want to create a stub.
I give following commands
d:\xml> rmic rmi.HelloRmi
d:\xml\rmi> rmic rmi.HelloRmi
but it gives following error
Exception in thread "main" java.lang.NoClassDefFoundError: sun/tools/java/Constants
at java.lang.ClassLoader.defineClass0(native method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:486)
etc.....
Any help will be appreciated
 
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Pilania,
I am assuming that you have d:\xml in your classpath. Create a sub directory called rmi and put these 3 files in this sub -directory. You should not have any problem in compiling and creating stubs. Please let me know if you face any other problems.
Regards,
Milind

[This message has been edited by Milind Kulkarni (edited June 27, 2000).]
 
pilania
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Milind
I do not have d:\xml is classpath bit it is in my path. I have d:\jdk1.3\lib only in my classpath.
And i do have rmi directory its strucutre is d:\xml\rmi and al three class files are in there too.
For all its worth even if i enter rmic and press enter it gives me the same error.
 
Milind Kulkarni
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Pilania,
If you see such errors - that means that your CLASSPATH is not set to point at the working directory.
My path includes c:\jdk1.2.2\bin that is where my java and javac stuff is.
My classpath points to c:\Examples which is where I put my .java files that I'm working on.
Change your PATH to point to d:\jdk1.3\lib and CLASSPATH to d:\xml.
Hope this helps!!
Regards,
Milind

[This message has been edited by Milind Kulkarni (edited June 27, 2000).]
 
pilania
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Milind
I appreciate your suggestions/thoughts. But the problem is fixed. Here is how
I have J2sdkee1.2.1 installed on my machine. It needs that you put couple of J2EE jar files in
root(C: or d /jdk1.2.2 (or jdk1.3)/jre/lib/ext. I removed them files and voila.
Ofcourse your suggestion about putting my work directory in the classpath was what finally did it.
\\// Live Long and Prosper
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I believe you can also fix this by copying the file <JAVA_HOME>/lib/tools.jar into <JAVA_HOME>/jre/ext (since it isn't always convenient to move j2ee.jar around). [Unfortunately, it didn't seem to work just adding the tools.jar file into the classpath.]
 
High Plains Drifter
Posts: 7289
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Pilania -
Please take a moment and change your screen name to reflect JavaRanch's naming policy. And thanks for coming to our forums to participate.
Regards,
Michael
 
I was born with webbed fish toes. This tiny ad is my only friend:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic