Skip to content

Commit 8296592

Browse files
authored
fix: don't depend on JAVA_HOME (#341)
On my Mac, I don't have a Java installation, so I can't run Coursier in a repo rule. Error looks like the following: ``` ERROR: An error occurred during the fetch of repository 'maven': Traceback (most recent call last): File "/private/var/tmp/_bazel_alexeagle/ae0af0834eef79816f461fa88cebe300/external/rules_jvm_external/coursier.bzl", line 795, column 13, in _coursier_fe common --enable_platform_specific_config tch_impl fail("Unable to run coursier: " + hasher_exec_result.stderr) Error in fail: Unable to run coursier: The operation couldn’t be completed. Unable to locate a Java Runtime. ```
1 parent eaf2daa commit 8296592

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

.bazelrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,7 @@ build --incompatible_java_common_parameters=false
2323
# HOME appears to be required by //pkg/plugin/grpc/grpc:grpc_test
2424
# (for github.com/bazelbuild/rules_go/go/tools/bazel_testing)
2525
test --action_env=HOME
26+
27+
# Don't depend on a JAVA_HOME pointing at a system JDK
28+
# see https://github.com/bazelbuild/rules_jvm_external/issues/445
29+
build --repo_env=JAVA_HOME=../bazel_tools/jdk

0 commit comments

Comments
 (0)