未正确定义JAVA_HOME编译时出错 [英] JAVA_HOME is not defined correctly Error while compiling

查看:146
本文介绍了未正确定义JAVA_HOME编译时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用一些java类在cocoa中开发一个应用程序。我收到错误JAVA_HOME未正确定义我们无法执行/System/Library/Frameworks/JavaVM.framework/Home/bin/java\".I不要知道如何解决这个问题。请任何人帮助我..

I am developing an aplication in cocoa which uses some java classes .I am getting an error "JAVA_HOME is not defined correctly We cannot execute /System/Library/Frameworks/JavaVM.framework/Home/bin/java".I dont know how to resolve this..Please anyone help me..

提前致谢

推荐答案

export JAVA_HOME=`/usr/libexec/java_home` is exactly what you want to do.

事实上,所有的Apache项目(好吧,任何项目真的)硬编码/系统/库/Frameworks/JavaVM.framework/Versions / ...需要使用/ usr / libexec / java_home(如果存在)。这是您了解Java是否实际安装的唯一方法。

In fact, all of the Apache projects (well, any project really) that hardcodes /System/Library/Frameworks/JavaVM.framework/Versions/... needs to use /usr/libexec/java_home if it exists. It's the only way you will know if Java is actually installed.

将来某些时候/system/Library/Frameworks/JavaVM.framework/Versions/中的符号链接将要离开,如果他们想要使用Oracle / OpenJDK JVM加载,这将更严重地打破这些项目。

At some point in the future the symlinks in /System/Library/Frameworks/JavaVM.framework/Versions/ will be going away, which will even more severely break these projects if they want to load using an Oracle/OpenJDK JVM.

这篇关于未正确定义JAVA_HOME编译时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆