简体   繁体   English

没有这样的文件或目录Java Ubuntu

[英]No such file or directory Java Ubuntu

I get the message no such file or directory as you can see in the image below: 我收到消息,没有您在下图中看到的此类文件或目录: 在此处输入图片说明

As you can see I do have a bin folder in /usr/lib/java/jdk1.8.0_144/bin 如您所见,我在/usr/lib/java/jdk1.8.0_144/bin确实有一个bin文件夹

In my .bashrc file I have the following contents: 在我的.bashrc文件中,我具有以下内容:

#Java HOME directory setup
export JAVA_HOME=/usr/lib/java/jdk1.8.0_144
export PATH="$PATH:$JAVA_HOME/bin"

I also came across the following 2 questions: 我还遇到了以下两个问题:

https://askubuntu.com/questions/207552/no-such-file-or-directory-when-invoking-java https://askubuntu.com/questions/207552/no-such-file-or-directory-when-invoking-java

Java is installed, in listing, but execution produces "./java: No such file or directory" 在清单中已安装Java,但执行时会产生“ ./java:没有这样的文件或目录”

And I had followed Petesh answer to use the ldd java command to see which packages I´m missing. 我按照Petesh的回答使用了ldd java命令来查看我缺少的软件包。 But as you can see in the image below it didn´t worked out: 但是,如您在下图中看到的那样,它没有解决问题: 在此处输入图片说明

However I can see that both java -version and ldd --version commands are working. 但是我可以看到java -versionldd --version命令都可以正常工作。 I´m using a 64-bit notebook. 我正在使用64位笔记本电脑。 Can someone maybe help me, please? 有人可以帮我吗?

java appears to be correctly installed, you can run "java" with java似乎已正确安装,您可以使用

$ java <MYOPTIONS>

Your error is trying to execute your "PATH" with $PATH if you want to display the path, you echo it. 您的错误是试图使用$PATH执行“ PATH”,如果您想显示路径,则回显它。 Like, 喜欢,

$ echo $PATH

Or, if you want to find where java is 或者,如果您想找到java在哪里

$ type -path java
/usr/bin/java

Or, the more usual Ubuntu way 或者,更常见的Ubuntu方法

$ update-java-alternatives -l
java-1.8.0-openjdk-amd64       1081       /usr/lib/jvm/java-1.8.0-openjdk-amd64
java-8-oracle                  1081       /usr/lib/jvm/java-8-oracle

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

相关问题 Java FileWriter 类 - java.io.FileNotFoundException: * 没有这样的文件或目录 -Ubuntu - Java FileWriter class - java.io.FileNotFoundException: * no such file or directory -Ubuntu 在Ubuntu中无法使用Java在指定目录中写入文件 - In ubuntu unable to write file in specified directory using java 让 Java 可以访问 ubuntu 服务器中的目录/文件 - let Java have access to a directory/file in ubuntu server 尝试从 java.lang.Process 编译 java 项目时,在 Ubuntu 上没有出现此类文件或目录异常 - Getting No such File or Directory Exception on Ubuntu when trying compile a java project from java.lang.Process 在Ubuntu上设置Java环境路径的麻烦(libjvm.so:无法打开共享对象文件:没有这样的文件或目录) - Trouble in Setting Java Environment Path on Ubuntu (libjvm.so: cannot open shared object file: No such file or directory) 在Ubuntu上的Eclipse中将目录添加到Java库路径 - adding a directory to the Java library path in Eclipse on Ubuntu 使用Java在Ubuntu中创建目录时出错 - Getting Error Creating Directory In Ubuntu Using Java 在Java中使用SSH读取远程Ubuntu目录? - Reading remote Ubuntu directory using ssh in java? Java - 网络目录不是文件或目录? - Java - Network directory not a file or directory? ubuntu中java代码中的文件路径 - File path in java code in ubuntu
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM