简体   繁体   English

Eclipse中的Maven项目 - 也许您运行的是JRE而不是JDK

[英]Maven project in Eclipse - Perhaps you are running on JRE rather than JDK

I have the same problem as in the post: No compiler is provided in this environment. 我遇到了与帖子相同的问题: 在这种环境中没有提供编译器。 Perhaps you are running on a JRE rather than a JDK? 也许您运行的是JRE而不是JDK?

I follow the steps of the first comment in that post. 我按照该帖子中第一条评论的步骤进行操作。 But I can not find a JDK folder. 但我找不到JDK文件夹。 To illustrate this I add a picture how it looks like: 为了说明这一点,我添加了一幅图片:

在此输入图像描述

So, as you can see, I have no jdk- folder . 所以,正如你所看到的,我没有jdk文件夹。 And I would like to know, why? 我想知道,为什么? And what to do? 怎么办? When I run "clean install" from the command line, then everything is okay. 当我从命令行运行“clean install”时,一切正常。 In Eclipse, I get the message that I run perhaps on JRE instead of JDK. 在Eclipse中,我得到的消息是我在JRE而不是JDK上运行。

edit: I have also installed the jdk folder. 编辑:我还安装了jdk文件夹。 Here again, a picture: 再来一张图片: 在此输入图像描述

I have make for you the the various steps to follow to specify the JDK to use with Eclipse. 我已经为您指定了要与Eclipse一起使用的JDK的各个步骤。 Of course you can make more than one JDK then in the build path for any project You can specify the JRE. 当然,您可以在任何项目的构建路径中创建多个JDK您可以指定JRE。

Here is same Screen shots: 这是相同的屏幕截图:

Step1: 第1步:

在此输入图像描述

Step 2: 第2步:

在此输入图像描述

Step 3 第3步

在此输入图像描述 :

You must tell Eclipse the location of the JDK you want it to use. 您必须告诉Eclipse您希望它使用的JDK的位置。

You do this in the Preferences on the 'Java > Installed JREs' page. 您可以在“Java>已安装的JRE”页面的“首选项”中执行此操作。 If the JDK is not shown there click the 'Add...' button. 如果未显示JDK,请单击“添加...”按钮。 Choose the type of JRE/JDK (normally 'Standard VM' except on a Mac). 选择JRE / JDK的类型(通常为“标准VM”,Mac上除外)。 On the next page enter the directory containing the JDK. 在下一页上,输入包含JDK的目录。

Once you have entered the JDK location it will show in the list on the Installed JREs page. 进入JDK位置后,它将显示在Installed JREs页面的列表中。 Click OK to close the Preferences and save this list. 单击“确定”关闭“首选项”并保存此列表。 You can then open the Preferences again and the JDK should now be shown in the Execution Environments page. 然后,您可以再次打开“首选项”,现在应该在“执行环境”页面中显示JDK。

Perhaps your java_home variable is set to use jre rather than jdk. 也许你的java_home变量设置为使用jre而不是jdk。 Change your java_home variable as 'C:\\Program Files\\Java\\jdk1.8.0_25' accordingly. 相应地将您的java_home变量更改为“C:\\ Program Files \\ Java \\ jdk1.8.0_25”。 Also jdk_home variable as 'C:\\Program Files\\Java\\jdk1.8.0_25'. 另外jdk_home变量为'C:\\ Program Files \\ Java \\ jdk1.8.0_25'。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Maven 错误:也许您在 JRE 而不是 JDK 上运行? - Maven error :Perhaps you are running on a JRE rather than a JDK? 也许您在 JRE 而不是 JDK 上运行? - Perhaps you are running on a JRE rather than a JDK? 错误 也许您在 JRE 而不是 JDK 上运行? - Error Perhaps you are running on a JRE rather than a JDK? 此环境中不提供编译器。 也许您在 JRE 而不是 JDK 上运行? - 但是选择了jdk - No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? - but jdk selected Jenkins Windows slave:此环境不提供编译器。 也许您在 JRE 上运行而不是在 JDK 上运行 - Jenkins Windows slave: No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK mvn clean package error: 此环境没有提供编译器。 也许您在 JRE 而不是 JDK 上运行? - mvn clean package error: No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? jenkins 管道错误 此环境中未提供编译器 也许您在 JRE 上而不是 JDK 上运行 - jenkins pipeline error No compiler is provided in this environment Perhaps you are running on a JRE rather than a JDK Mac os 大苏尔 | 此环境中不提供编译器。 也许您在 JRE 而不是 JDK 上运行? - Mac os Big Sur | No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? 此环境中未提供编译器。 也许您在 JRE 而不是 JDK 上运行? - No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? 此环境中未提供编译器。 也许您在 JRE 而不是 JDK 上运行? 在视觉工作室代码中 - No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? in visual studio code
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM