无法在“/ usr / bin / java / bin / java”中找到可执行文件。 (-1) [英] Unable to locate an executable at "/usr/bin/java/bin/java" (-1)
问题描述
我的mac osx 10.7.3中有一个可疑的Java问题。
之前我安装它并且工作正常。
在一段时间内对.bash_profile和.profile文件进行一些更改后,
我遇到错误,如
I am having a pathetic issue with Java in my mac osx 10.7.3 . Previously I installed it and it was working fine. After some changes in the .bash_profile and .profile file in the course of time, I am having an error like
Unable to locate an executable at "/usr/bin/java/bin/java"
每当我尝试在终端中运行javac或java时。
whenever I try to run "javac" or "java" in my terminal .
echo $ PATH
给出输出如:
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/sabya/Documents/Play_Framework/play-2.0:/usr/X11/bin:/usr/local/git/bin:/usr/local/mysql/bin
我的.bash_profile看起来像:
My .bash_profile looks like :
alias start_mysql="/Library/StartupItems/MySQLCOM/MySQLCOM start"
alias stop_mysql="/Library/StartupItems/MySQLCOM/MySQLCOM stop"
export JAVA_HOME=/usr/bin/java
输出哪个java
/usr/bin/java
它烦我很长一段时间,卸载和安装ja va没有帮助我的运气。
Its bugging me for long days and uninstalling and installing java did not help my luck .
我是Mac的新手,需要帮助解决这个问题。
I am a newbie in Mac and need help to sort out this issue .
谷歌搜索并在发布此问题之前看到SOF,但没有找到任何特定于我的问题。
Googled and saw SOF before posting this question but did not find anything specific to my problem .
谢谢
Sabya
推荐答案
当然, export JAVA_HOME = / usr / bin / java
是罪魁祸首。此env var应指向JDK或JRE安装目录。谷歌搜索显示,MacOS X的最佳选项似乎是 export JAVA_HOME = / Library / Java / Home
。
Most certainly, export JAVA_HOME=/usr/bin/java
is the culprit. This env var should point to the JDK or JRE installation directory. Googling shows that the best option for MacOS X seems to be export JAVA_HOME=/Library/Java/Home
.
这篇关于无法在“/ usr / bin / java / bin / java”中找到可执行文件。 (-1)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!