https://www.cnblogs.com/shihua513/p/6163682.html

在eclipse下用maven编译时,很有可能出现以下错误:

Please ensure you are using JDK 1.4 or above and
not a JRE (the com.sun.tools.javac.Main class is required).

// 请确保您使用的是JDK 1.4或以上版本

不是一个JRE(com.sun.tools.javac。主类是必需的)。//

原因:eclipse默认是使用jre作为运行环境,而maven编译需要jdk作为运行环境。

我们只要做如下更改即可。

在eclipse中打开,

window -> preferences -> Java -> installed jres,点击add->选择Standard VM,新加一个环境,设为默认环境,注意location选择为你的jdk目录。

然后再去编译你的项目,就OK了。

如果还是不行,就在你的项目上右击,build path -> configure build path,编辑JRE System Library,选择刚才新建的默认环境

再去编译即可。

Maven报错Please ensure you are using JDK 1.4 or above and not a JRE解决方法!的更多相关文章

  1. Maven报错Please ensure you are using JDK 1.4 or above and not a JRE

    在部署Jenkins项目时,用Jenkins调用服务器上脚本时,脚本在服务器上执行没有任何问题,但是在Jenkins上调用时就报错,提示mvn应该使用全路径执行,当加入jdk,jre,maven环境变 ...

  2. 阿里云oss上传图片报错,The OSS Access Key Id you provided does not exist in our records.解决方法

    vue项目 1.安装OSS的Node SDK npm install ali-oss --save 2.参考官方提示https://help.aliyun.com/document_detail/11 ...

  3. 相对路径获取项目文件 及报错 No mapping found for HTTP request with URI XXX in DispatcherServlet with name ‘springmvc’解决方法

    首先一点,WebRoot目录下的文件是都可以通过浏览器输入路径,直接读取到的 例如这样: 而WebRoot下面WEB-INF是无法浏览器输入路径直接读取的. 因为是受保护的. 如果jsp读取一个图片的 ...

  4. mysql报错"ERROR 1206 (HY000): The total number of locks exceeds the lock table size"的解决方法

    1. 问题背景         InnoDB是新版MySQL(v5.5及以后)默认的存储引擎,之前版本的默认引擎为MyISAM,因此,低于5.5版本的mysql配置文件.my.cnf中,关于InnoD ...

  5. MyEclipse报错 Building workspace has encountered a problem Errors occurred during the build 的2种解决方法

    1: Building workspace has encountered a problem Errors occurred during the build 如果报错这个 那么有可能是jar包,报 ...

  6. Vue报错:Uncaught TypeError: Cannot assign to read only property’exports‘ of object’#<Object>‘的解决方法

    发现问题 运行一下以前的一个Vue+webpack的 vue仿新闻网站  小项目,报错 由于自己vue学习不深入,老是这个报错,找了好久(确切的说是整整一下午^...^)才找到原因 -v- Uncau ...

  7. 【MySQL笔记】mysql报错"ERROR 1206 (HY000): The total number of locks exceeds the lock table size"的解决方法

    step1:查看 1.1 Mysql命令行里输入"show engines:"查看innoddb数据引擎状态, 1.2 show variables "%_buffer% ...

  8. node.js报错throw err; // Rethrow non-MySQL errors e:\serverTest\node_modules\mysql\lib\protocol\Parser.js:79 解决方法

    今天在用node+angular做后台时,需要使用session保存登陆状态的时候,遇到了此问题,问题直译为非mysql问题,我也在后台取到的登陆用户名和密码,确实不是数据库问题.最后发现在使用ses ...

  9. 报错:/BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3512.29.5/UITableView.m:7943解决方法

    环境:Xcode7.1.1 详细错误: *** Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:], ...

随机推荐

  1. EXP7 网络欺诈技术防范(修改版)

    实践内容 本实践的目标理解常用网络欺诈背后的原理,以提高防范意识,并提出具体防范方法. 1.简单应用SET工具建立冒名网站 2.ettercap DNS spoof 3.结合应用两种技术,用DNS s ...

  2. Codeforces Round #424 (Div. 2, rated, based on VK Cup Finals) Problem A - B

    Array of integers is unimodal, if: it is strictly increasing in the beginning; after that it is cons ...

  3. 【python010-数组】

    1.创建列表 *创建普通列表 >>> member = ['尘封','破冰','python']>>> member['尘封', '破冰', 'python'] * ...

  4. 【python005-数据类型】

    数据类型 一.字符串的相加是拼接,数字的相加是求和 二.python的数值类型:整形,浮点型,e记法,布尔类型 >>> 1.2e412000.0>>> 1.2e-4 ...

  5. qt无法定位程序输入点 于动态链接库 qt5core.dll

    造成步骤:一开始是将现成的dll[Qt5.9.3]放在文件夹里,然后使用Qt5.7.1编译的exe放进去,产生标题错误 原因:dll库不匹配 解决:使用Qt5.7.1自带的cmd命令行,使用winde ...

  6. POP-OOP-SOP-COP-SOA-AOP

    一.面向过程 二.面向对象 三.面向服务 四.补充 五.总结: 英文及缩写: 面向过程:procedure oriented programming POP 面向对象:object oriented ...

  7. k8s2

    1.主节点与子节点如何沟通,交互 apiServer <==> kublet 2. pod之间如何共享, 使用volumn(数据卷 ) kube-proxy 和 service 配置好网络 ...

  8. Gitflow 视频讲解

      How to use a scalable Git branching model called Gitflow   git视频合集列表   github大本营   gitflow中文备忘清单   ...

  9. POJ 1426 Find The Multiple(寻找倍数)

    POJ 1426 Find The Multiple(寻找倍数) Time Limit: 1000MS    Memory Limit: 65536K Description - 题目描述 Given ...

  10. Lintcode521-Remove Duplicate Numbers in Array-Easy

    Description Given an array of integers, remove the duplicate numbers in it. You should: Do it in pla ...