NDK: ant 错误 [javah] Exception in thread "main" java.lang.NullPointerException 多种解决办法
1、错误提示内容

2、ant脚本对应的内容
<?xml version="1.0" encoding="UTF-8"?>
<!-- ======================================================================
2016-8-28 下午3:26:45 HellNDK
description cjy
====================================================================== -->
<project name="HelloNDK" default="BuildAllHeaders">
<description>
description
</description> <!-- =================================
target: BuildAllHeaders
================================= -->
<target name="BuildAllHeaders">
<antcall target="BuildGetStringHeader">
</antcall>
<antcall target="BuildGetIntHeader">
</antcall>
</target> <!-- - - - - - - - - - - - - - - - - -
target: depends
- - - - - - - - - - - - - - - - - -->
<target name="BuildGetStringHeader">
<javah destdir="./jni" classpath="./bin/classes/" class="com.example.hellondk.GetString">
</javah>
</target> <!-- - - - - - - - - - - - - - - - - -
target: BuildGetIntHeader
- - - - - - - - - - - - - - - - - -->
<target name="BuildGetIntHeader"> </target> </project>
3、解决方案
方法(1)
进行下列步骤:Run -> External Tools -> External Tools Configurations dialog
在界面中选择jre选项

选择Run in Same JRE as workspace
全部完成后,在进行重新编译,一般情况下,问题就可以解决了。要是没有解决,参考方法(2)
参考来源:http://stackoverflow.com/questions/15032230/cant-load-javah-error-in-eclipse
方法(2) 在上图界面中,选择Separete JRE,选择一个新的jre。

如上图所示,我安装了jdk1.8.0_51。选择之后,点击ok确定。然后在重新进行编译,错误应该就会没有了。
当然,要是你没有安装新的jre,那么安装一个和自己的eclipse版本对应的jdk(记住安装位置),安装好之后,点击上图的Search找到自己安装jdk的位置,导进来就可以了。
NDK: ant 错误 [javah] Exception in thread "main" java.lang.NullPointerException 多种解决办法的更多相关文章
- JAVA错误:Exception in thread "main" java.lang.NullPointerException
JAVA错误:Exception in thread "main" java.lang.NullPointerException例如: Exception in thread &q ...
- GUI学习中错误Exception in thread "main" java.lang.NullPointerException
运行时出现错误:Exception in thread "main" java.lang.NullPointerException 该问题多半是由于用到的某个对象只进行了声明,而没 ...
- 给内部类对象数组属性赋值时报错:Exception in thread "main" java.lang.NullPointerException
前言 1255: 打怪升级(Java),写这个题目程序的时候,控制台提示如下错误: Exception in thread "main" java.lang.NullPointer ...
- MyBatis3错误:Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Priority的问题解决
在使用Maven新建QuitStart类型项目时,引入了MyBatis3.2.0版本的JAR包之后,出现如下错误: Exception in thread "main" java. ...
- java使用类数组 报错Exception in thread "main" java.lang.NullPointerException
源代码如下: Point[] points=new Point[n];//Point是一个类 for(int i=0;i<n;i++) { System.out.print("请输入x ...
- Exception in thread "main" java.lang.NullPointerException
1.在window操作系统上,使用eclipse开发工具从hdfs分布式文件系统上下载文件报空指针异常解决方法: log4j:WARN No appenders could be found for ...
- xml出现Exception in thread "main" java.lang.NullPointerException
运行代码出现Exception in thread "main" java.lang.NullPointerException 可以看下这个链接:https://ask.csdn. ...
- MyEclipse8.5集成Tomcat7时的启动错误:Exception in thread “main” java.lang.NoClassDefFoundError org/apache/commons/logging/LogFactory
今天,安装Tomcat7.0.21后,单独用D:\apache-tomcat-7.0.21\bin\startup.bat启动web服务正常.但在MyEclipse8.5中集成配置Tomcat7后,在 ...
- MyEclipse8.5集成Tomcat7时的启动错误:Exception in thread “main” java.lang.NoClassDefFoundError org/apache/commons/logging/LogFactory
今天,安装Tomcat7.0.21后,单独用D:\apache-tomcat-7.0.21\bin\startup.bat启动web服务正常.但 在MyEclipse8.5中集成配置Tomcat7后, ...
随机推荐
- rest 参数与扩展运算符
rest 参数与扩展运算符 1.rest 参数 ES6 引入 rest 参数(形式为...变量名),用于获取函数的多余参数,这样就不需要使用arguments对象了.rest 参数搭配的变量是一个数组 ...
- 自动创建数据库(DELPHI+SQL SERVER)
procedure TForm1.Btn_OKClick(Sender: TObject); var sqlconn:string; begin Sqlconn:='Provider=SQLOLEDB ...
- Ubuntu16版本中安装MongoDB
https://docs.mongodb.com/manual/tutorial/install-mongodb-on-linux/ //授权 https://docs.mongodb.com/man ...
- java:LeakFilling (Linux)
1.Nosql 列数据库,没有update,非关系型数据库: 为了解决高并发.高可扩展.高可用.大数据存储问题而产生的数据库解决方案,就是NoSql数据库. NoSQL,泛指非关系型的数据库,NoS ...
- Structured streaming: A Declarative API for Real-Time Applications in Apache Spark(Abstract: 原文+注译)
题目中文:结构化流: Apache spark中,处理实时数据的声明式API Abstract with the ubiquity of real-time data, organizations n ...
- Docker-Compose运行Nginx+Redis+NetCoreAPI
Docker-Compose运行Nginx+Redis+NetCoreAPI 一.准备Docker-Compose Docker 开始安装Docker-compose之前你需要先确认已经安装了Dock ...
- Python学习之认知(一)
第二章(一) 2.1 python介绍 2.1.1 python是一种什么样的语言 编程语⾔主要从以下几个⻆度为进行分类,编译型和解释型.静态语言和动态语⾔.强类型定义语言和弱类型定义语言. 编译 ...
- 121. 买卖股票的最佳时机( Best Time to Buy and Sell Stock)
题目地址:https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock/ 解题思路一:暴力求解法 根据题目我们可以知道,我们知道最大 ...
- caoz的梦呓:信息安全常识科普
猫宁!!! 参考链接:https://mp.weixin.qq.com/s/cl4TfOodBGSjUuEU8e0rGA 对方公众号:caoz的梦呓 前天在新加坡IC咖啡做了一场关于信息安全的常识普及 ...
- SLAM+语音机器人DIY系列:前言
------SLAM+语音机器人DIY系列[目录]快速导览------ 第1章:Linux基础 1.Linux简介 2.安装Linux发行版ubuntu系统 3.Linux命令行基础操作 第2章:RO ...