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后, ...
随机推荐
- LC 358. Rearrange String k Distance Apart
Given a non-empty string s and an integer k, rearrange the string such that the same characters are ...
- The inherit, initial, and unset values
The inherit, initial, and unset keywords are special values you can give to any CSS property. Tests ...
- pyqt5在QMainWindow中布局的问题
在pyqt5中使用了父类为QMainWindow的话,在里面使用布局类,QGridLayout, QHBoxLayout ,QVBoxLayout 时,发现不好用. 解决: 如果是在以QWidget为 ...
- Kafka 可视化工具(Kafka Tool)
Kafka 可视化工具 使用Kafka的小伙伴,有没有为无法直观地查看 Kafka 的 Topic 里的内容而发过愁呢? 下面推荐给大家一款带有可视化页面Kafka工具:Kafka Tool (目前最 ...
- SQLserver本地数据库开发
远程端数据库中生成脚本 注意 远程端的数据库 是中文版的还是英文版的,一般我们装的是英文版的, 如果远程端数据库是中文版的,那么我们本地的是英文版,在生成的脚本那需要修改,同时去除相应的路劲代码. 修 ...
- .NET 实现复制粘贴功能
老是把自己当作珍珠,就时时有怕被埋没的痛苦.把自己当作泥土吧,让众人把你踩成一条道路. -----<泥土>鲁藜 .NET如何实现复制粘贴功能,具体代码如下: aspx文件: <div ...
- python网络应用篇
正则表达式 import re #引入正则表达式模块 使用re.match/search函数进行匹配(区别:match只匹配字符串的开始,如果不符合正则表达式,则匹配失败,返回None,而searc ...
- 03-初识JavaScript
一. JavaScript简介(了解) 1. JavaScript的历史背景介绍 布兰登 • 艾奇(Brendan Eich,1961年-),1995年在网景公司,发明的JavaScript. 一开始 ...
- 外连接的用法 -- 《SQL进阶教程》 jupyter note
import pandas as pd import sqlite3 conn = sqlite3.connect('1-5.db') 用外连接进行行列转换1(行 -> 列): 制作交叉表 怎么 ...
- java 给不同成绩分等级
题目:利用条件运算符的嵌套来完成此题:学习成绩>=90分的同学用A表示,60-89分之间的用B表示,60分以下的用C表示. 程序分析:(a>b)?a:b这是条件运算符的基本例子. pack ...