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 Language Support not working for Codespaces #3516

Open
FRC9289 opened this issue Mar 5, 2024 · 6 comments
Open

Java Language Support not working for Codespaces #3516

FRC9289 opened this issue Mar 5, 2024 · 6 comments

Comments

@FRC9289
Copy link

FRC9289 commented Mar 5, 2024

We are a team that's running the First Robotics Competition and we want to sync our code between different devices.
We chose GitHub codespaces since we already using GitHub.
Everything works fine except Java language support kind of not able to find java
image
image
We tried >add dev and add new java configuration to the codespace, but it didn't fix the problem

Is there any way to add Java to code spaces or let the extension recognize our local Java? That will be super helpful!

Copy link

github-actions bot commented Mar 5, 2024

We have found issues that are potential duplicates:

If any of the issues listed above are a duplicate, please consider closing this issue & upvoting/commenting the original one.
Alternatively, if neither of the listed issues addresses your feature/bug, keep this issue open.

1 similar comment
Copy link

github-actions bot commented Mar 5, 2024

We have found issues that are potential duplicates:

If any of the issues listed above are a duplicate, please consider closing this issue & upvoting/commenting the original one.
Alternatively, if neither of the listed issues addresses your feature/bug, keep this issue open.

@fbricon
Copy link
Collaborator

fbricon commented Mar 5, 2024

Have you looked at the codespaces+java documentation?

@testforstephen or @jdneo might be more familiar with running on codespace

@testforstephen
Copy link
Collaborator

"java.jdt.ls.java.home" setting is machine scope, and it cannot be shared across devices. In the context of GitHub Codespaces, this setting can only point to a path within the GitHub Codespaces development machine.

@fbricon
Copy link
Collaborator

fbricon commented Mar 5, 2024

I've tried https://github.com/microsoft/vscode-remote-try-java and while it runs fine on codespaces, It failed to run as a devcontainer locally, with a similar issue as @FRC9289's (failing to use the java.jdt.ls.java.home value from my own user settings.json, in the container). To fix the problem, I changed https://github.com/microsoft/vscode-remote-try-java/blob/main/.devcontainer/devcontainer.json#L18-L26 to override the vscode settings running in that container: set the java.jdt.ls.java.home path to a proper value, and override java.configuration.runtimes to an empty array :

// Configure tool-specific properties.
"customizations": {
	// Configure properties specific to VS Code.
	"vscode": {
		"settings": {
			"java.jdt.ls.java.home": "/usr/lib/jvm/msopenjdk-current",
			"java.configuration.runtimes": []
		},
		"extensions": [
			"jbangdev.jbang-vscode"
		]
	}
}

@FRC9289
Copy link
Author

FRC9289 commented Mar 7, 2024

We gave up on using codespaces and changed to git now, thanks for everyone's help!

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

No branches or pull requests

3 participants