简体   繁体   English

无法在 Ubuntu 22 中使用终端安装 Java

[英]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$ 

enter image description here在此处输入图像描述

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.您可能会问为什么不能在命令行中使用javajavac

You need to set your PATH and JAVA_HOME environment variables first, before the java command becomes available everywhere.您需要先设置PATHJAVA_HOME环境变量,然后java命令才能随处可用。

Check this post to see how to do that. 检查这篇文章,看看如何做到这一点。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM