Ndk:ant error [Javah] Exception in thread "main" java.lang.NullPointerException multiple solutions

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.