Extracting c++ header from jar file using javah  
Author Message
rmcalinden





PostPosted: 2004-9-21 4:46:00 Top

java-programmer, Extracting c++ header from jar file using javah I'm trying to create a native header from an existing jar file
(actually, only one class w/in the jar file). I've tried all sorts of
command line arguments (w/ classpath) and nothing seems to work.

Here's the setup:

* package is blah.jar and contains dozens of classes, one of which I'm
interested in creating a .h for (blahClass.java)
* I have the source for it in another directory but its dependencies
are pretty large and I figure using javah on the .jar file would be
easiest?
* why wouldn't this work:

javah -classpath c:\temp\work\blah.jar blahClass

blahClass is also part of a larger package (net.program.message) so I
also tried:

javah -classpath c:\temp\work\blah.jar net.program.message.blahClass

nothing works.

any ideas? thx
 
Michael Saunby





PostPosted: 2004-9-21 5:20:00 Top

java-programmer >> Extracting c++ header from jar file using javah
"Rmac" <email***@***.com> wrote in message
news:email***@***.com...
> I'm trying to create a native header from an existing jar file
> (actually, only one class w/in the jar file). I've tried all sorts of
> command line arguments (w/ classpath) and nothing seems to work.
>
> Here's the setup:
>
> * package is blah.jar and contains dozens of classes, one of which I'm
> interested in creating a .h for (blahClass.java)
> * I have the source for it in another directory but its dependencies
> are pretty large and I figure using javah on the .jar file would be
> easiest?
> * why wouldn't this work:
>
> javah -classpath c:\temp\work\blah.jar blahClass
>
> blahClass is also part of a larger package (net.program.message) so I
> also tried:
>
> javah -classpath c:\temp\work\blah.jar net.program.message.blahClass
>
> nothing works.
>
> any ideas? thx

I'll bet "it works" - it just doesn't work as you believe it should. I've
used javah before, but not in the way you describe - I've used it to create
.h files when I've defined native methods, which is I expect what it's
actually for.

Maybe you need to take a look at SWIG http://www.swig.org, and even rethink
what it is you're trying to do.

Michael Saunby



 
hilz





PostPosted: 2004-9-21 7:15:00 Top

java-programmer >> Extracting c++ header from jar file using javah > * why wouldn't this work:
>
> javah -classpath c:\temp\work\blah.jar blahClass
>
> blahClass is also part of a larger package (net.program.message) so I
> also tried:
>
> javah -classpath c:\temp\work\blah.jar net.program.message.blahClass
>
> nothing works.
>
> any ideas? thx





What error message do you get?