JAVA_HOME points to the wrong place

2019-02-25 16:58发布

I seem to have an incorrectly specified JAVA_HOME variable. I can get around it for many things but now I am seem to be stuck. I am trying to use the Google App Engine and upload an application.

When I do so I get the error that the error:

cannot find javac executable based on java.home, tried "C:\Program Files\Java\jre6\bin\javac.exe" and "C:\Program Files\Java\bin\javac.exe"

I don't understand why it is looking there, doing echo %JAVA_HOME% gives me:

C:\Program Files\Java\jdk1.6.0_14

Which is where Java actually is. I am thinking my best hope might be to just put Java where it is looking for it - can you think of anything better.

3条回答
Summer. ? 凉城
2楼-- · 2019-02-25 17:36

Or simply add "C:\Program Files\Java\jdk1.6.0_14\bin" to your %PATH%

查看更多
混吃等死
3楼-- · 2019-02-25 17:38

Double check for any typo in the JAVA_HOME path.

查看更多
够拽才男人
4楼-- · 2019-02-25 17:54

Looks like it's possibly a bug:

http://code.google.com/p/googleappengine/issues/detail?id=1226

There are lots of suggested workarounds/solutions, but comment #24 in the bug entry seems promising:

The problem is that GAE plugin for Eclipse is default configured with a JRE instead of a JDK.

To change this, do the following:

Preferences > Java > Installed JRE's > Add... For 'JRE Type' select 'Standard VM' > Next > Directory: select your JDK directory (instead of JRE) (in my case: C:\Program Files\Java\jdk1.6.0_16 ), press OK.

Now, you are back at 'Installed JRE's', select the JDK here also.

查看更多
登录 后发表回答