Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to 'bazel run' a java_binary with a specified JAVA_HOME #5516

Closed
bansalvinayak opened this issue Jul 4, 2018 · 3 comments
Closed
Assignees
Labels
P1 I'll work on this now. (Assignee required) platform: windows type: bug

Comments

@bansalvinayak
Copy link

Description of the problem / feature request:

Unable to 'bazel run' a java_binary with a specified JAVA_HOME

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

bazel run --host_javabase=:jdk8 --javabase=:jdk8 :hello_world

results in
LAUNCHER ERROR: Rlocation failed on C:/openjdk/bin/java.exe, path doesn't exist in MANIFEST file

Relevant files (BUILD and HelloWorld.java)

package(default_visibility = ["//visibility:public"])
java_library(
name = "hello_lib",
srcs = glob(["*.java"]),
)

java_binary(
name = "hello_world",
main_class = "hello.HelloWorld",
runtime_deps = [
":hello_lib",
],
)

java_runtime_suite(
  name = "jdk8",
  default = ":jdk8-default",
)
   
java_runtime(
  name = "jdk8-default",
  srcs = [],
  java_home = "C:/openjdk",
)


package hello;
public final class HelloWorld {
public static void main(String[] args) throws Exception {
System.out.println("Hello, world!");
}
}

What operating system are you running Bazel on?

Windows Server Core 1803

What's the output of bazel info release?

release 0.13.0

Have you found anything relevant by searching the web?

After speaking with @jasharpe,

I think there is a bug with the launcher

if (blaze_util::IsAbsolute(path)) {

If the path is absolute, we should return it regardless of whether the manifest file is empty or not

@bansalvinayak
Copy link
Author

@bansalvinayak
Copy link
Author

Oh, i should add this setup needed an empty WORKSPACE file as well.

@laszlocsomor laszlocsomor added type: bug P1 I'll work on this now. (Assignee required) platform: windows labels Jul 5, 2018
@meteorcloudy
Copy link
Member

@bansalvinayak Thanks for reporting! You're right about the bug, I'll fix it soon!

werkt pushed a commit to werkt/bazel that referenced this issue Aug 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 I'll work on this now. (Assignee required) platform: windows type: bug
Projects
None yet
Development

No branches or pull requests

3 participants