[英]Unable to install Java using terminal in Ubuntu 22
I have been trying to install java using deb file using terminal.我一直在尝试使用终端使用 deb 文件安装 java。 However terminal keep on showing 3 lines and exiting.
但是终端继续显示 3 行并退出。
(Reading database ... 212600 files and directories currently installed.)
Preparing to unpack jdk-18_linux-x64_bin.deb ...
Unpacking jdk-18 (18.0.1.1-ga) over (18.0.1.1-ga) ...
Setting up jdk-18 (18.0.1.1-ga) ...
shiddalingayya@shiddalingayya-ThinkPad-E15-Gen-2:~/Downloads$
From what I can tell, the installation seems to finish successfully.据我所知,安装似乎成功完成。 I don't see any errors.
我没有看到任何错误。 What you might ask is why can't you use the
java
or javac
in the command line.您可能会问为什么不能在命令行中使用
java
或javac
。
You need to set your PATH
and JAVA_HOME
environment variables first, before the java
command becomes available everywhere.您需要先设置
PATH
和JAVA_HOME
环境变量,然后java
命令才能随处可用。
Check this post to see how to do that. 检查这篇文章,看看如何做到这一点。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.