• 全部
  • 音视频
  • Camera
  • UI
  • SDK
  • Android Studio
  • 问答

centos 8 使用sdkmanager去更新tools时报错

fabbymee 软件配置/软件测试/软件开发  2021-05-14 04:54:46
我用的是最新的commandlinetools-linux-7302050_latest.zip
sudo unzip android-sdk.zip -d .
sudo ./cmdline-tools/bin/sdkmanager "tools"
ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.
...全文
168 点赞 收藏 1
写回复
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
fabbymee 05-16
sudo ./cmdline-tools/bin/sdkmanager "tools" ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation. cmdline-tools/bin/sdkmanager文件有下面的代码 # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables JAVACMD="$JAVA_HOME/jre/sh/java" else JAVACMD="$JAVA_HOME/bin/java" fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else JAVACMD="java" which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi 但是sudo which java which: no java in (/sbin:/bin:/usr/sbin:/usr/bin)会报错 ./cmdline-tools/bin/sdkmanager "tools" Error: Could not determine SDK root. Error: Either specify it explicitly with --sdk_root= or move this package into its expected location: <sdk>/cmdline-tools/latest/ 改用下面 ./cmdline-tools/bin/sdkmanager "tools" --sdk_root=/home/android/android_sdk/sdk
回复
发帖
Android
创建于2009-10-09

7.8w+

社区成员

移动平台 Android
申请成为版主
帖子事件
创建了帖子
2021-05-14 04:54
社区公告
暂无公告