简体   繁体   English

bash:java:找不到命令(Fedora)

[英]bash : java : command not found (Fedora)

On Fedora I installed (or at least tried to install) JDK-18.在 Fedora 上,我安装了(或至少尝试安装)JDK-18。 I rebooted my laptop and wanted to check if it succeeded.我重新启动了我的笔记本电脑,想检查它是否成功。 I used java --version , but it said bash: java: command not found .我使用了 java --version ,但它说bash: java: command not found

Well all that I will write is subjective.好吧,我要写的所有内容都是主观的。 It all depends upon how did you install java in Fedora.这完全取决于您如何在 Fedora 中安装 java。 If you downloaded the jdk distribution and unzipped it to some folder.如果您下载了 jdk 发行版并将其解压缩到某个文件夹。 Then in your.bashrc, you need to provide the path where the binaries are available然后在 your.bashrc 中,您需要提供二进制文件可用的路径

export PATH=$PATH:/path/to/java/installation/folder/bin导出 PATH=$PATH:/path/to/java/installation/folder/bin

You can also look at sdkman https://sdkman.io/也可以看看sdkman https://sdkman.io/

This is a nice tool to manage your JDK(s) regardless of Linux distribution you are using.这是一个很好的工具来管理您的 JDK(s),无论您使用的是 Linux 发行版。 (disclaimer: I have no affiliation with sdkman - i find this tool very helpful) (免责声明:我与 sdkman 没有任何关系——我发现这个工具非常有用)

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

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