How to create c++ header files for imagej java classes

when i run javah - C header and Stub file generator it throughs an error as attatched below,

Is there any other solution to create c++ header files for java classes?

Hi @vamsee_menda,

huh, this sounds a bit off topic. But still: How did you get this “javah” thingy? Can ensure somehow, that it is installed properly? What happens, if you run the tool from the command line with just a simple java class, like shown on this website?

Furthermore, what is the goal of your project? It may be easier to point you in the right direction, if you tell us, what you are trying to do? Why do you think you need c-header files for imagej? What would you do with them, if they were available?


hi haesleinhuepf,

Thank’s for the Reply,
iam new to java but i want to interface imagej with labview by converting the java classes into c++ headers to make a dll files according to requirements this my goal.

Actually i downloaded from ecllipse neon from “” and jdk from “” (Java SE Development Kit 8u111 ‘jdk-8u111-windows-x64.exe’) i think eclipse is installed properly. I dn’t Know how to check whether it correctly installed or not.

I downloaded source code of imagej1.x from github from “”. When i run the source code it opens the imagej apllication in that i do the operations, So i concluded that eclipse installed properly.

After that i want to create a c++ header files after seeing this video""
Imagej already having classes but in different folder in the same directory i used javah in cmd line and i concatenate the classes path using -classpath “full classpath folder” then it shows

i tried in similar way by keeping -o “path of the class” but it shows the similar error in the cmd prompt as mentioned before.

I tried in the ecllipse with Javah -C header and stub file generator

its External tools Configuration is attatched below

Then i run the javah -c header and stub file generator it throws error

is there any solution to solve this issue

Thank’s in advance

Hi @vamsee_menda,

it will not work this easily. javah is for creating header files for native methods, that is C methods that can be invoked from java. You should look into the JNI documentation
It explains both how to call from Java into C (this is what you need javah for) and from C into Java (bringing up a JVM and then instantiating classes, calling methods, etc…). The latter is probably closer to what you want to do. Running javah on IJ.class will give you nothing because IJ doesn’t declare any native methods.

best regards,