如何使用Bazel在Android项目中导入OrmLite?

时间:2019-07-24 14:13:47

标签: android bazel ormlite

我正在尝试在使用Bazel构建系统的Android项目中导入Ormlite。

这是我在WORKSPACE文件中所做的,

maven_install(
artifacts = [
    "com.j256.ormlite:ormlite-core:4.17",
    # ...
],
repositories = [
    "https://maven.google.com",
    "https://jcenter.bintray.com",
],

`

maven_install(
artifacts = [
    "com.j256.ormlite:ormlite-android:5.1",
    # ...
],
repositories = [
    "https://maven.google.com",
    "https://jcenter.bintray.com",
],

我正在将这些依赖项导入到BUILD文件中,

"@maven//:com_j256_ormlite_ormlite_core",
"@maven//:com_j256_ormlite_ormlite_android",

我收到此错误

no such package '@maven//': Unable to run coursier: /home/sensen/.cache/bazel/_bazel_sensen/48ad891aa751c505019ab8d123867f07/external/maven/coursier: line 2: exec: java: not found

ERROR

1 个答案:

答案 0 :(得分:0)

您需要在系统上安装java才能运行coursier来获取依赖项。 Follow these steps下载OpenJDK。