GoogleCloudPlatform / cloud-code-intellij

Plugin to support the Google Cloud Platform in IntelliJ IDEA - Docs and Issues Repository
Apache License 2.0
319 stars 59 forks source link

Intellij run configuration fails - Skipping Jib: no JVM #3142

Closed bogdhy closed 1 year ago

bogdhy commented 1 year ago

When I run the configurations Develop on Kubernetes generated by the plugin, I receive the following error: Skipping Jib: no JVM: [java -version] failed: exec: "java": executable file not found in $PATH

But if I run the same skaffold command manually from the terminal everything works as expected.

image

Expected Behavior

To be able to run the helm charts using the JIB compiler with any issues, running the command from the terminal manually: image

Actual Behavior

Running from the IDE image

image

Additional Information

etanshaul commented 1 year ago

hi @bogdhy . this is an interesting one. when you run java -version from the IDE terminal it finds it on the path?

bogdhy commented 1 year ago

hi @bogdhy . this is an interesting one. when you run java -version from the IDE terminal it finds it on the path?

Hello, I just found out the issue, while testing what you said above, I started to look at the IDE terminal settings and saw that the $PATH env is different in the IDE than the one I have in the terminal.

After adding the JDK path to the $PATH manually in the IDE it worked: image

Thank you for your help!

The issue is with the IDE and not the the google cloud plugin.

etanshaul commented 1 year ago

glad it worked! thanks for the update

bogdhy commented 1 year ago

glad it worked! thanks for the update

Hello, quick update, with the latest IDE update (2023.2), the fix did not work anymore.

The new solution was to override the "PATH" env at the run configuration level like this:

image

Hope this would save some headaches :smile:

etanshaul commented 1 year ago

thanks for providing the workaround. Unclear what the change was that affected this yet. @ivanporty do you know by any chance?

ivanporty commented 1 year ago

We might be changing PATH to include some of the tools needed for skaffold, but that should not affect the original PATH. We will double check this.