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

Java Development Kit Required webview always showing #143

Closed
ThadHouse opened this issue Apr 26, 2019 · 8 comments · Fixed by #144 or #146
Closed

Java Development Kit Required webview always showing #143

ThadHouse opened this issue Apr 26, 2019 · 8 comments · Fixed by #144 or #146

Comments

@ThadHouse
Copy link
Contributor

ThadHouse commented Apr 26, 2019

Ever since the update to 0.7.0, upon opening any Java project the Webview saying the JDK is required always pops up, even though my system has JDK 11 on it. The checkbox saying Show overview page when using Java is ignored as well.

JavaMessage

Environment
  • Operating System: Windows 10
  • JDK version:
openjdk version "11" 2018-09-25
OpenJDK Runtime Environment 18.9 (build 11+28)
OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)
  • Visual Studio Code version: 1.33.1
  • Java extension version: 0.7.0
Steps To Reproduce
  1. Open a Java gradle project on windows 10.
Current Result

The webview shows

Expected Result

No webview to show

Additional Informations

The intellisense works, so the webview is just being invasive, and is just wrong.

@ThadHouse
Copy link
Contributor Author

It looks like why this is happening is my JDK returns the following as its string from -version

openjdk version "11" 2018-09-25
OpenJDK Runtime Environment 18.9 (build 11+28)
OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)

This fails the regex that is being used.

@akaroml
Copy link
Member

akaroml commented Apr 27, 2019

It looks like why this is happening is my JDK returns the following as its string from -version

openjdk version "11" 2018-09-25
OpenJDK Runtime Environment 18.9 (build 11+28)
OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)

This fails the regex that is being used.

Thank you for your feedback and sorry about this case. A fix will be out next week to cover more JDK distributions correctly.

@ThadHouse
Copy link
Contributor Author

Thanks. I guess maybe a bigger question is why isn't this extension just using the java home detection that the redhat extension exposes through it's extension API. That would give all the information required, make sure it's in sync, and reduce duplicated code. As an extension pack, this already has a dependency on that. All the other java extensions switched to use that API to reduce code duplication.

@akaroml
Copy link
Member

akaroml commented Apr 27, 2019

Thanks. I guess maybe a bigger question is why isn't this extension just using the java home detection that the redhat extension exposes through it's extension API. That would give all the information required, make sure it's in sync, and reduce duplicated code. As an extension pack, this already has a dependency on that. All the other java extensions switched to use that API to reduce code duplication.

I'm not aware of the extension API by Red Hat. Could you point me to that?

@ThadHouse
Copy link
Contributor Author

https://github.com/Microsoft/vscode-java-debug/blob/master/src/utility.ts#L108

It exposes the java home it finds for other extensions, and leaves it undefined if a jdk is not found.

This is the full API that is exposed
https://github.com/redhat-developer/vscode-java/blob/master/src/extension.api.ts

@ThadHouse
Copy link
Contributor Author

I think that might be a better option. I'll open another PR to use that concept as well, that way you can choose which solution you like better.

@akaroml
Copy link
Member

akaroml commented Apr 28, 2019

I think that might be a better option. I'll open another PR to use that concept as well, that way you can choose which solution you like better.

https://github.com/Microsoft/vscode-java-debug/blob/master/src/utility.ts#L108

It exposes the java home it finds for other extensions, and leaves it undefined if a jdk is not found.

This is the full API that is exposed
https://github.com/redhat-developer/vscode-java/blob/master/src/extension.api.ts

This is perfect. I'll try that too.

@ThadHouse
Copy link
Contributor Author

I opened up both as PRs so you can try both easily.

@akaroml akaroml mentioned this issue Apr 29, 2019
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

Successfully merging a pull request may close this issue.

2 participants