On 30 May 2005 11:32:25 -0700,
steves- wrote:
> If anybody has had any success in using JNI with a servlet, I would
> to hear how they configured it to work.
The first step is to get javah working properly (and this has nothing
to do with servlets)...
> Running javah gets the following error:
>
> bash-2.05b$ javah -jni XppIf
> error: cannot access XppIf
> bad class file: C:\BioSpring\xpserv\XppIf.class
> class file contains wrong class: xpserv.XppIf
> Please remove or make sure it appears in the correct subdirectory
> of the classpath.
> com.sun.tools.javac.util.Abort
> :
>
> Running javah with the package name included in the name still fails:
>
> bash-2.05b$ javah -jni xpserv.XppIf
> error: cannot access xpserv.XppIf
> file xpserv\XppIf.class not found
> javadoc: error - Class xpserv.XppIf not found.
> Error: No classes were specified on the command line. Try -help.
You *must* use the package name when you run javah, or the generated
symbol names will be incorrect and you will get UnsatisfiedLinkErrors
when you try to invoke them.
The second example fails because you need C:\BioSpring in the
classpath, not C:\BioSpring\xpserv.
/gordon
--
[ do not email me copies of your followups ]
g o r d o n + n e w s @ b a l d e r 1 3 . s e