rules_kotlin icon indicating copy to clipboard operation
rules_kotlin copied to clipboard

Java executable path issue when running kt_jvm_test on macos

Open zhengguang-chen opened this issue 4 years ago • 1 comments

When we run the kt_jvm_test rule on mac os, it ends up looking for java executable in exec path instead of runfiles path, which causes the run failed with the error message like <java-path>/bin/java: No such file or directory.

It seems that the issue is caused by a bug in the rule implementation.

The location of the java binary is set here, which is using java_executable_exec_path. That seems inconsistent with what rules_scala is doing in the same scenario, which used java_executable_runfiles_path. According to the document, the later one should be using for execution during tests.

The solution will be changing java_executable_exec_path to java_executable_runfiles_path from here..

zhengguang-chen avatar Apr 21 '21 21:04 zhengguang-chen

One workaround here is to add java_test rule instead, then depends on kt_jvm_library.

zhengguang-chen avatar Sep 13 '21 17:09 zhengguang-chen