Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / December 2005

Tip: Looking for answers? Try searching our database.

Stupid user question on rmic

Thread view: 
Joseph Dionne - 23 Dec 2005 19:55 GMT
I have the following directory tree structure and contents therein.

./class
`-- com
    `-- project
        `-- services
            `-- lib
                |-- Hello.class

As I read the docs on rmic, the following command line should result in the
creation of ./class/com/project/services/lib/Hello_Stub.class.

rmic -v1.2 -classpath class -d class com.project.services.lib.Hello

However, I get the following ClassNotFoundException

java.lang.ClassNotFoundException: com.project.services.lib.Hello not found in
[file:./, core:/]
   at java.net.URLClassLoader.findClass(java.lang.String)
(/usr/lib/libgcj.so.4.0.0)
   at gnu.gcj.runtime.VMClassLoader.findClass(java.lang.String)
(/usr/lib/libgcj.so.4.0.0)
   at java.lang.ClassLoader.loadClass(java.lang.String, boolean)
(/usr/lib/libgcj.so.4.0.0)
   at _Jv_FindClass(_Jv_Utf8Const, java.lang.ClassLoader)
(/usr/lib/libgcj.so.4.0.0)
   at java.lang.Class.forName(java.lang.String, boolean,
java.lang.ClassLoader) (/usr/lib/libgcj.so.4.0.0)
   at java.lang.Class.forName(java.lang.String) (/usr/lib/libgcj.so.4.0.0)
   at gnu.java.rmi.rmic.RMIC.findClass() (/usr/lib/libgcj.so.4.0.0)
   at gnu.java.rmi.rmic.RMIC.analyzeClass(java.lang.String)
(/usr/lib/libgcj.so.4.0.0)
   at gnu.java.rmi.rmic.RMIC.processClass(java.lang.String)
(/usr/lib/libgcj.so.4.0.0)
   at gnu.java.rmi.rmic.RMIC.run() (/usr/lib/libgcj.so.4.0.0)
   at gnu.java.rmi.rmic.RMIC.main(java.lang.String[]) (/usr/lib/libgcj.so.4.0.0)

What bonehead thing am I not doing corectly?

Joseph
Jean-Francois Briere - 23 Dec 2005 20:05 GMT
Simple test, try by specifying absolute paths:

rmic -v1.2 -classpath /some/absolute/path/class -d
/some/absolute/path/class com.project.services.lib.Hello
Joseph Dionne - 23 Dec 2005 20:21 GMT
> Simple test, try by specifying absolute paths:
>
> rmic -v1.2 -classpath /some/absolute/path/class -d
> /some/absolute/path/class com.project.services.lib.Hello

Same result, ClassNotFoundException.  However, if I change directory to the
"class" directory, and run the following command line it works fine.

rmic -v1.2 -classpath . -d . com.project.service.lib.Hello

I have tried absolute path, relative path, i.e. "./class", and rmic seems not
to use "-classpath' BUT, just on a lark, I tried the following command line
and it works.

CLASSPATH=./class rmic -v1.2 -d class com.project.services.lib.Hello

I assume rmic has a bug with option "-classpath"

Thanks for help, work around found and will be used.

Joseph
Joseph Dionne - 23 Dec 2005 21:14 GMT
>> Simple test, try by specifying absolute paths:
>>
[quoted text clipped - 17 lines]
>
> Joseph

I am using SuSE Linux, and it has someone's third party rmic command, which is
what I was running, not Sun's JDK rmic.

In short, Sun's rmic works as documented.

Sorry for the confusion, and thanks for the help
Joseph
VisionSet - 23 Dec 2005 20:14 GMT
> As I read the docs on rmic, the following command line should result in the
> creation of ./class/com/project/services/lib/Hello_Stub.class.
>
> rmic -v1.2 -classpath class -d class com.project.services.lib.Hello
>
> However, I get the following ClassNotFoundException

If you use SDK1.5 you don't need to use rmic,  javac does the lot

--
Mike W


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.