Stupid user question on rmic

J

Joseph Dionne

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
 
J

Jean-Francois Briere

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
 
V

VisionSet

Joseph Dionne said:
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
 
J

Joseph Dionne

Jean-Francois Briere said:
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
 
J

Joseph Dionne

Joseph said:
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


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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top