Extracting c++ header from jar file using javah

R

Rmac

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
 
M

Michael Saunby

Rmac said:
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
 
H

hilz

* 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?
 

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

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top