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

Run in Java editor fails #80

Open
vorburger opened this issue Jan 5, 2024 · 3 comments
Open

Run in Java editor fails #80

vorburger opened this issue Jan 5, 2024 · 3 comments

Comments

@vorburger
Copy link
Contributor

vorburger commented Jan 5, 2024

When I open code java_one/ of https://github.com/vorburger/LearningBazel, it opens just fine (see #74).

However clicking Run (the gray "hover" thing, of Run | Debug) says Build failed, do you want to continue? (from Source: Debugger for Java)

There are no related errors in the usual Troubleshooting logs (that I could see).

With this extension, is this a "bug" because @guw this works for you in other projects, or is it "totally expected" and so this just a possible future Frequent Request (FR)?

BTW that Bazel Run Targets tab in the Explorer view is also empty... should there be something there, given the java_binary(name = "JavaOne", ... of that small sample project?

@guw
Copy link
Collaborator

guw commented Jan 6, 2024

I think for the Bazel Run Targets we rely on importing IJ run configurations. @lonhutt do you know if this works with arbitrary java_binary targets`

@vorburger
Copy link
Contributor Author

@guw just FYI (#111 is more important) when I press the Run | Debug on https://github.com/enola-dev/enola/blob/e6240391f16815c0b30e9c0ab10def17aff786e7/tools/hello/src/main/java/dev/enola/common/hello/Hello.java then the Terminal has:

cd /home/vorburger/git/github.com/en
ola-dev/enola ; /usr/bin/env /usr/lib/jvm/java-21-openjdk-21.0.2.0.13-1.fc39.x86_64/bin/java -agentlib:jdwp=transport=dt_socke
t,server=n,suspend=y,address=localhost:33795 @/tmp/cp_5j8filafnox1ol2nueofo8mx9.argfile dev.enola.common.hello.Hello
Error: Could not find or load main class dev.enola.common.hello.Hello
Caused by: java.lang.ClassNotFoundException: dev.enola.common.hello.Hello

So it looks like it's not putting anything on the -cp ...

@vorburger
Copy link
Contributor Author

It seems to create a new .vscode/launch.json (which I didn't have before) which contains, among other things:

{
      "type": "java",
      "name": "Hello",
      "request": "launch",
      "mainClass": "dev.enola.common.hello.Hello",
      "projectName": "tools.hello:hello"
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants