简体   繁体   English

Mac上的Java安装在哪里?

[英]Where is java installed on my mac?

I am having trouble finding where java is installed on my mac. 我找不到在Mac上安装Java的位置。 I am trying to downgrade from java 1.8 to java 1.7. 我正在尝试从Java 1.8降级到Java 1.7。

When I run the command /usr/libexec/java_home it returns /Library/Java/JavaVirtualMachines/jdk1.8.0_11.jdk/Contents/Home but the trouble is when I go to the Library folder there is no Java folder. 当我运行命令/usr/libexec/java_home它返回/Library/Java/JavaVirtualMachines/jdk1.8.0_11.jdk/Contents/Home但是麻烦是当我转到Library文件夹时没有Java文件夹。 I've tried navigating there in terminal and it says -bash: cd: Java: No such file or directory 我尝试在终端中导航,它显示-bash: cd: Java: No such file or directory

How can I get the Java folder to show? 如何显示Java文件夹? I was thinking maybe it is hidden. 我当时想也许是隐藏的。 Or what other commands can I use that will point me to where Java is installed? 或者我还能使用哪些其他命令将我指向Java的安装位置?

Try: 尝试:

which java

This should give you the path of the java binary. 这应该为您提供Java二进制文件的路径。 It might be a link to another file, which you'll be able to check with: 它可能是指向另一个文件的链接,您可以使用以下文件进行检查:

ls -l `which java`

In your case Java doesn't seem to have been removed completely. 在您的情况下,Java似乎尚未完全删除。

Go to /Library/PreferencePanes/JavaControlPanel.prefPane and remove it from command line. 转到/Library/PreferencePanes/JavaControlPanel.prefPane并将其从命令行中删除。 You might need sudo access. 您可能需要sudo访问。

Also remove the JavaAppletPlugin from /Library/Internet\\ Plug-Ins/JavaAppletPlugin.plugin Again sudo access is necessary 还要从/ Library / Internet \\ Plug-Ins / JavaAppletPlugin.plugin中删除JavaAppletPlugin。再次需要sudo访问

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

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