Why does sbt report quot;No java installations was detectedquot; with $JAVA_HOME set?(为什么 sbt 报告“未检测到 Java 安装?设置了 $JAVA_HOME ?)
本文介绍了为什么 sbt 报告“未检测到 Java 安装"?设置了 $JAVA_HOME ?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
I have 2 sbt-android-scala projects. The first one is a single one:
$ ls -al
drwxr-xr-x 13 alex staff 442 Dec 24 20:44 .
drwxr-xr-x 4 alex staff 136 Dec 24 21:08 ..
drwxr-xr-x 12 alex staff 408 Dec 24 20:38 .git
-rw-r--r-- 1 alex staff 141 Dec 24 20:38 .gitignore
-rw-r--r-- 1 alex staff 115 Dec 24 20:38 .travis.yml
-rw-r--r-- 1 alex staff 664 Dec 24 20:38 CHANGES
-rw-r--r-- 1 alex staff 1418 Dec 24 20:38 LICENSE
-rw-r--r-- 1 alex staff 2491 Dec 24 20:38 README.md
-rw-r--r-- 1 alex staff 874 Dec 24 20:38 build.sbt
drwxr-xr-x 10 alex staff 340 Dec 24 20:38 notes
drwxr-xr-x 5 alex staff 170 Dec 24 20:43 project
drwxr-xr-x 3 alex staff 102 Dec 24 20:38 src
drwxr-xr-x 5 alex staff 170 Dec 25 01:17 target
The second one has sub-projects in it:
$ ls -al
drwxr-xr-x 23 alex staff 782 Dec 24 21:57 .
drwxr-xr-x 4 alex staff 136 Dec 24 21:08 ..
drwxr-xr-x 13 alex staff 442 Dec 24 21:57 .git
-rw-r--r-- 1 alex staff 44 Dec 24 21:57 .gitignore
-rw-r--r-- 1 alex staff 203 Dec 24 21:57 .gitmodules
-rw-r--r-- 1 alex staff 46 Dec 24 21:57 .sbtopts
-rw-r--r-- 1 alex staff 55 Dec 24 21:57 .sbtrc
-rw-r--r-- 1 alex staff 35119 Dec 24 21:57 LICENSE.md
-rw-r--r-- 1 alex staff 6964 Dec 24 21:57 README.md
-rw-r--r-- 1 alex staff 30626 Dec 24 21:57 RELEASE-NOTES.md
drwxr-xr-x 18 alex staff 612 Dec 24 21:57 my_prj1
-rw-r--r-- 1 alex staff 892 Dec 24 21:57 build.sbt
drwxr-xr-x 11 alex staff 374 Dec 24 21:57 common
drwxr-xr-x 11 alex staff 374 Dec 24 21:57 my_prj2
drwxr-xr-x 3 alex staff 102 Dec 24 21:57 my_prj3
drwxr-xr-x 7 alex staff 238 Dec 24 22:01 project
When I run sbt
in the 1st project, it compiles well, unlike in the 2nd one:
$ sbt
No java installations was detected.
Please go to http://www.java.com/getjava/ and download
But
$ echo $JAVA_HOME
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
解决方案
It appears that either of your .sbt files are misconfigured resulting in an error. Can you try renaming them and it could fix your problem.
这篇关于为什么 sbt 报告“未检测到 Java 安装"?设置了 $JAVA_HOME ?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
沃梦达教程
本文标题为:为什么 sbt 报告“未检测到 Java 安装"?设置了 $JAVA_HOME ?
基础教程推荐
猜你喜欢
- android 应用程序已发布,但在 google play 中找不到 2022-01-01
- UIWebView 委托方法 shouldStartLoadWithRequest:在 WKWebView 中等效? 2022-01-01
- 在 gmail 中为 ios 应用程序检索朋友的朋友 2022-01-01
- Kivy Buildozer 无法构建 apk,命令失败:./distribute.sh -m “kivy"d 2022-01-01
- 如何让对象对 Cocos2D 中的触摸做出反应? 2022-01-01
- 如何在 iPhone 上显示来自 API 的 HTML 文本? 2022-01-01
- Android:对话框关闭而不调用关闭 2022-01-01
- 如何在没有IB的情况下将2个按钮添加到右侧的UINavigationbar? 2022-01-01
- 如何在 UIImageView 中异步加载图像? 2022-01-01
- 当从同一个组件调用时,两个 IBAction 触发的顺序是什么? 2022-01-01