2

Hi All,

While migrating from Java 8 to Java 10 , I came accross a strange issue. In our legacy system there is a JNI layer and we are generating the header file from a .class file using the below command like:

javah -jni -classpath classes -o jpdm.h com.osm.biz.pdm

This set of command is giving me the issue like:

Error: Could not find class file for 'com.osm.biz.pdm'.

I am getting this perticular issue while compiling in JAVA 10.

Strange thing is when I replace the same .class file (pdm.java) built in Java 8 and execute the same command as above , I don't get any issue.

My question

  1. Is Java 10 no more support header file generation through above command ?

  2. Is there any alternative way to generate header file creation using Java 10?

vibhas
  • 1,449
  • 4
  • 18
  • 32
  • Seems like javah is not available for JDK10: https://stackoverflow.com/questions/49506237/generate-jni-header-files-for-class-files-in-jdk-10?rq=1 – enveeed Sep 06 '18 at 09:31
  • Anywork around? – vibhas Sep 06 '18 at 09:35
  • 1
    javah was removed in JDK 10, the recommend way since JDK 8 is to generate header file has been with "javac -h". – Alan Bateman Sep 06 '18 at 12:59
  • But we can't apply this for a .class file. – vibhas Sep 07 '18 at 06:06
  • I am trying to create a header file with name jpdm.h . This header file is created through a python script. Any way I can use something like this?javac -h -classpath jpdm.h com.osm.biz.pdm.java. But it is not working. – vibhas Sep 07 '18 at 06:17

0 Answers0