1. Error message Content
2. What the ant script corresponds to
1 <?XML version= "1.0" encoding= "UTF-8"?>2 <!-- ====================================================================== 3 2016-8-28 pm 3:26:454 5 HELLNDK6 Description7 8 Cjy9 ====================================================================== -Ten <Projectname= "HELLONDK"default= "Buildallheaders"> One <Description> A Description - </Description> - the <!-- ================================= - target:buildallheaders - ================================= - - <Targetname= "Buildallheaders"> + <AntcallTarget= "Buildgetstringheader"> - </Antcall> + <AntcallTarget= "Buildgetintheader"> A </Antcall> at </Target> - - <!-- - - - - - - - - - - - - - - - - - - Target:depends - - - - - - - - - - - - - - - - - - - - <Targetname= "Buildgetstringheader"> in <Javah destdir= "./jni" classpath= "./bin/classes/" class = "Com.example.hellondk.GetString" > - </Javah> to </Target> + - <!-- - - - - - - - - - - - - - - - - - the Target:buildgetintheader * - - - - - - - - - - - - - - - - - - $ <Targetname= "Buildgetintheader">Panax Notoginseng - </Target> the + A </Project>
3. Solutions
Method (1)
Perform the following steps: Run, External tools, External Tools Configurations dialog
Select the JRE option in the interface
Select Run in same JRE as workspace
Once all is done, the problem can be solved by recompiling, in general. if not resolved, refer to Method (2)
Reference Source: Http://stackoverflow.com/questions/15032230/cant-load-javah-error-in-eclipse
Method (2) in the interface, select the separete JREand select a new JRE.
As shown, I installed the jdk1.8.0_51. After selecting, click OK. Then when you re-compile, the error should be gone.
Of course, if you don't have a new JRE installed, install a jdk that corresponds to your version of Eclipse(remember the installation location), and then click Search to find the location where you installed the JDK.
Ndk:ant error [Javah] Exception in thread "main" java.lang.NullPointerException multiple solutions