英文:
Ubuntu Java Application Not finding the command javac when java 11 is confirmed installed
问题
我正在尝试运行一个 Java 应用程序,但显示 "javac not found"。当我使用以下命令安装了 Java 后:
> sudo apt install openjdk-11-jre-headless
它已经在我的路径中,因为我可以正常运行 java 命令。我不确定为什么它无法找到 javac 命令。在安装了 openjdk-11 后,我漏掉了什么步骤?
英文:
I am trying to run a java application, but its saying javac not found. When I did install java by using the following command:
> sudo apt install openjdk-11-jre-headless
It's in my path as I can run java command fine. I'm not sure why it isn't seeing the javac command. What am I missing after installing openjdk-11 java ?
答案1
得分: 8
你已经安装了Java运行时环境(JRE):openjdk-11-jre
,这允许您运行Java软件。
您还应该安装Java开发工具包(JDK)以便编译代码:
sudo apt install openjdk-11-jdk
英文:
You have installed the Java Runtime Environment (JRE): openjdk-11-jre
which allows you to run java software.
And should install the Java Developer Kit (JDK) in order to compile code:
sudo apt install openjdk-11-jdk
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论