JAVA_HOME in MacOSX

CocosIDE打包APK报:
Error: JAVA_HOME is not defined correctly.
We cannot execute /System/Library/Frameworks/JavaVM.framework/Home/bin/java


把ant脚本这一段删掉:
--- /opt/local/share/java/apache-ant/bin/ant.orig 2012-02-09 12:02:30.000000000 -0500
+++ /opt/local/share/java/apache-ant/bin/ant 2012-02-09 12:02:53.000000000 -0500
@@ -83,11 +83,7 @@
mingw=false;
case "`uname`" in
CYGWIN*) cygwin=true ;;
- Darwin*) darwin=true
- if [ -z "$JAVA_HOME" ] ; then
- JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home
- fi
- ;;
+ Darwin*) darwin=true ;;
MINGW*) mingw=true ;;
esac

参考:
[url]https://bz.apache.org/bugzilla/show_bug.cgi?id=52632[/url]
cmake_minimum_required(VERSION 3.16) project(untitled VERSION 0.1 LANGUAGES CXX) set(CMAKE_CXX_STANDARD_REQUIRED ON) find_package(Qt6 REQUIRED COMPONENTS Quick) qt_standard_project_setup(REQUIRES 6.5) qt_add_executable(appuntitled main.cpp ) qt_add_qml_module(appuntitled URI untitled VERSION 1.0 QML_FILES Main.qml ) # Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1. # If you are developing for iOS or macOS you should consider setting an # explicit, fixed bundle identifier manually though. set_target_properties(appuntitled PROPERTIES # MACOSX_BUNDLE_GUI_IDENTIFIER com.example.appuntitled MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION} MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} MACOSX_BUNDLE TRUE WIN32_EXECUTABLE TRUE ) target_link_libraries(appuntitled PRIVATE Qt6::Quick ) include(GNUInstallDirs) install(TARGETS appuntitled BUNDLE DESTINATION . LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) 有什么问题吗 为什么会报错:-1: error: FAILURE: Build failed with an exception. :-1: error: * Where: Build file '/Users/qingguo/Desktop/nounou/yes/Helloworld/untitled/build/Qt_6_5_8_Clang_arm64_v8a-Debug/android-build/build.gradle' line: 17 * What went wrong: A problem occurred evaluating root project 'android-build'. > Failed to apply plugin 'com.android.internal.application'. > Android Gradle plugin requires Java 17 to run. You are currently using Java 11. Your current JDK is located in /Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home You can try some of the following options: - changing the IDE settings. - changing the JAVA_HOME environment variable. - changing `org.gradle.java.home` in `gradle.properties`. * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. > Get more help at https://help.gradle.org. :-1: error: BUILD FAILED in 1s :-1: error: Building the android package failed! -- For more information, run this command with --verbose.
最新发布
04-09
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值