No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
时间: 2023-09-24 20:08:35 浏览: 88
As an AI language model, I don't have the context to provide a specific solution. However, the error message suggests that you need to install a JDK (Java Development Kit) instead of a JRE (Java Runtime Environment) in order to compile your code. The JDK includes the compiler, while the JRE only includes the runtime environment. You can check your Java installation and make sure that you have the JDK installed. Alternatively, you can try using an online compiler or IDE that provides the necessary environment for compiling your code.
相关问题
maven install Compilation failure No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
当你在使用Maven构建项目时遇到"Compilation failure: No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?" 这样的错误,这通常意味着你在运行环境(JRE,Java Runtime Environment)上试图编译Java源代码,而Maven需要的是Java Development Kit (JDK),它包含了编译器(javac)。JDK不仅包含JRE,还有用于编译、打包和测试程序的工具。
解决这个问题的步骤如下:
1. 确保你已经安装了Java JDK而不是仅安装了JRE。你可以通过命令行检查`java -version` 和 `javac -version`,如果后者返回非零退出码,说明缺少编译器。
2. 如果没有安装JDK,从Oracle官网或者其他官方镜像下载并安装最新的JDK版本。
3. 配置系统的PATH环境变量,使得系统能够找到新安装的JDK的bin目录,这样才能正确地执行javac等命令。
no compiler is provided in this environment. perhaps you are running on a jre rather than a jdk?
这个环境中没有提供编译器。也许你正在运行 JRE 而不是 JDK?
这个错误提示表示当前运行环境中没有可用的编译器, 你需要在运行时安装 JDK(Java Development Kit) 才能编译运行你的 Java 程序。
相关推荐
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)