Language support for Java ™ for Visual Studio Code
=====================
[![Visual Studio Marketplace](https://img.shields.io/visual-studio-marketplace/v/redhat.java?style=for-the-badge&label=VS%20Marketplace&logo=visual-studio-code)](https://marketplace.visualstudio.com/items?itemName=redhat.java)
[![Installs](https://img.shields.io/visual-studio-marketplace/i/redhat.java?style=for-the-badge)](https://marketplace.visualstudio.com/items?itemName=redhat.java)
[![Join the chat at https://gitter.im/redhat-developer/vscode-java](https://img.shields.io/gitter/room/redhat-developer/vscode-java?style=for-the-badge&logo=gitter)](https://gitter.im/redhat-developer/vscode-java)
[![Build Status](https://img.shields.io/github/actions/workflow/status/redhat-developer/vscode-java/pr-verify.yml?branch=master&style=for-the-badge&logo=github)](https://github.com/redhat-developer/vscode-java/actions?query=workflow:pr-verify)
[![License](https://img.shields.io/github/license/redhat-developer/vscode-java?style=for-the-badge&logo=eclipse)](https://github.com/redhat-developer/vscode-java/blob/master/LICENSE)
Provides Java ™ language support via
[Eclipse ™ JDT Language Server](https://github.com/eclipse/eclipse.jdt.ls), which utilizes
[Eclipse ™ JDT](http://www.eclipse.org/jdt/), [M2Eclipse](http://www.eclipse.org/m2e/) and [Buildship](https://github.com/eclipse/buildship).
Quick Start
============
1. Install the Extension
2. On the following platforms, the extension should activate without any setup : `win32-x64`, `darwin-x64`, `darwin-arm64`, `linux-x64`, `linux-arm64`.\
If on another platform, or using the "universal" version, you can [set](#setting-the-jdk) a _Java_ Development Kit. It must be Java 17 or above.
3. Optionally, download and install a Java Development Kit for your project (Java 1.5 or above is supported). See [Project JDKs](#project-jdks) for more details
4. Extension is activated when you first access a Java file
* Recognizes projects with *Maven* or *Gradle* build files in the directory hierarchy.
Features
=========
![ screencast ](https://raw.githubusercontent.com/redhat-developer/vscode-java/master/images/vscode-java.0.0.1.gif)
* Supports code from Java 1.5 to Java 20
* Maven pom.xml project support
* Gradle project support (with experimental Android project import support)
* Standalone Java files support
* As-you-type reporting of parsing and compilation errors
* Code completion
* Code/Source actions / Refactoring
* Javadoc hovers
* Organize imports
- triggered manually or on save
- when pasting code into a java file with `Ctrl+Shift+v` (`Cmd+Shift+v` on Mac).
* Type search
* Code outline
* Code folding
* Code navigation
* Code lens (references/implementations)
* Highlights
* Code formatting (on-type/selection/file)
* Code snippets
* Annotation processing support (automatic for Maven projects)
* Semantic selection
* Diagnostic tags
* Call Hierarchy
* Type Hierarchy
To launch and debug your Java programs, it's recommended you install *[Java Debug Extension for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-debug)*.
See the [changelog](CHANGELOG.md) for the latest release. You might also find useful information in the project [Wiki](https://github.com/redhat-developer/vscode-java/wiki).
Setting the JDK
===============
## Java Tooling JDK
Now that Java extension will publish platform specific versions, it will embed a JRE for supported platforms such as `win32-x64`, `linux-x64`, `linux-arm64`, `darwin-x64`, `darwin-arm64`. The embedded JRE is used to launch the Language Server for Java. Users are only responsible for configuring [Project JDKs](#project-jdks) to compile your Java projects.
The following part is only kept for the universal version without embedded JRE.
>The tooling JDK will be used to launch the Language Server for Java. And by default, will also be used to compile your projects. Java 17 is the minimum required version.\
\
The path to the Java Development Kit can be specified by the `java.jdt.ls.java.home` setting in VS Code settings (workspace/user settings). If not specified, it is searched in the following order until a JDK meets current minimum requirement.
>- the `JDK_HOME` environment variable
>- the `JAVA_HOME` environment variable
>- on the current system path
## Project JDKs
If you need to compile your projects against a different JDK version, it's recommended you configure the `java.configuration.runtimes` property in your user settings, eg:
```json
"java.configuration.runtimes": [
{
"name": "JavaSE-1.8",
"path": "/path/to/jdk-8",
},
{
"name": "JavaSE-11",
"path": "/path/to/jdk-11",
},
{
"name": "JavaSE-20",
"path": "/path/to/jdk-20",
"default": true
},
]
```
The default runtime will be used when you open standalone Java files.
Available commands
==========================
The following commands are available:
- `Switch to Standard Mode`: switches the Java Language Server to `Standard` mode. This command is only available when the Java Language Server is in `LightWeight` mode.
- `Java: Reload Projects` (`Shift+Alt+U`): It forces project configuration / classpath updates (eg. dependency changes or Java compilation level), according to the project build descriptor.
- `Java: Import Java Projects into Workspace`: detects and imports all the Java projects into the Java Language Server workspace.
- `Java: Open Java Language Server Log File`: opens the Java Language Server log file, useful for troubleshooting problems.
- `Java: Open Java Extension Log File`: opens the Java extension log file, useful for troubleshooting problems.
- `Java: Open All Log Files`: opens both the Java Language Server log file and the Java extension log file.
- `Java: Force Java Compilation` (`Shift+Alt+B`): manually triggers compilation of the workspace.
- `Java: Rebuild Projects`: manually triggers a full build of the selected projects.
- `Java: Open Java Formatter Settings`: opens the Eclipse formatter settings. Creates a new settings file if none exists.
- `Java: Clean Java Language Server Workspace`: cleans the Java language server workspace.
- `Java: Attach Source`: attaches a jar/zip source to the currently opened binary class file. This command is only available in the editor context menu.
- `Java: Add Folder to Java Source Path`: adds the selected folder to its project source path. This command is only available in the file explorer context menu and only works for unmanaged folders.
- `Java: Remove Folder from Java Source Path`: removes the selected folder from its project source path. This command is only available in the file explorer context menu and only works for unmanaged folders.
- `Java: List All Java Source Paths`: lists all the Java source paths recognized by the Java Language Server workspace.
- `Java: Show Build Job Status`: shows the Java Language Server job status in Visual Studio Code terminal.
- `Java: Go to Super Implementation`: goes to the super implementation for the current selected symbol in editor.
- `Java: Restart Java Language Server`: restarts the Java language server.
Supported VS Code settings
==========================
The following settings are supported:
* `java.home` : **Deprecated, please use 'java.jdt.ls.java.home' instead.** Absolute path to JDK home folder used to launch the Java Language Server. Requires VS Code restart.
* `java.jdt.ls.lombokSupport.enabled`: Whether to enable lombok support. Defaults to `true`.
* `java.jdt.ls.vmargs` : Extra VM arguments used to launch the Java Language Server. Requires VS Code restart.
* `java.errors.incompleteClasspath.severity` : Specifies the severity of the message when the classpath is incomplete for a Java file. Supported values are `ignore`, `info`, `warning`, `error`.
* `java.trace.server` : Traces the communication between VS Code and the Java language server.
* `java.configuration.updateBuildConfiguration` : Specifies how modifications on bu
没有合适的资源?快使用搜索试试~ 我知道了~
Java for VS Code 的语言支持
共179个文件
ts:71个
json:21个
png:18个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 188 浏览量
2023-10-03
22:09:59
上传
评论
收藏 2.86MB ZIP 举报
温馨提示
通过 Eclipse JDT Language Server 提供 Java语言支持,该服务器利用 Eclipse JDT、M2Eclipse和 Buildship。现在 Java 扩展将发布特定于平台的版本,它将为受支持的平台(如 win32-x64、Linux-x64、Linux-arm64、darwin-x64 和 darwin-arm64)嵌入 JRE。嵌入式 JRE 用于启动 Java 语言服务器。用户只负责配置项目 JDK 来编译您的 Java 项目。
资源推荐
资源详情
资源评论
收起资源包目录
Java for VS Code 的语言支持 (179个子文件)
gradlew.bat 2KB
gradlew.bat 2KB
.classpath 295B
markdown.css 4KB
highlight.css 3KB
App.css 2KB
button.css 709B
document.css 315B
DCO 1KB
.editorconfig 175B
.eslintignore 261B
vscode-java.0.0.1.gif 1.95MB
.gitignore 214B
settings.gradle 362B
settings.gradle 359B
build.gradle 315B
build.gradle 80B
gradlew 5KB
gradlew 5KB
gradle-wrapper.jar 55KB
gradle-wrapper.jar 55KB
Foo2.java 1KB
Foo3.java 490B
Foo.java 381B
Foo.java 381B
TestJavadoc.java 311B
Bar.java 299B
Bar.java 284B
Foo.java 268B
Single.java 147B
WithError.java 144B
App.java 144B
Bar.java 119B
Foo.java 63B
Foo.java 63B
Foo.java 0B
Jenkinsfile 5KB
gulpfile.js 9KB
webpack.config.js 3KB
package-lock.json 311KB
package.json 57KB
java.tmLanguage.json 39KB
launch.json 4KB
JavaProperties.tmLanguage.json 3KB
server.json 3KB
.eslintrc.json 2KB
package.nls.json 2KB
package.nls.ko.json 2KB
package.nls.zh-cn.json 2KB
package.nls.zh-tw.json 1KB
tasks.json 1KB
java-properties-configuration.json 872B
language-configuration.json 742B
package.schema.json 732B
packageExample.json 540B
settings.json 524B
extensions.json 311B
tsconfig.webview.json 282B
tsconfig.json 211B
tsconfig.base.json 169B
LICENSE 14KB
CHANGELOG.md 176KB
README.md 27KB
_java.learnMoreAboutRefactorings.md 12KB
CONTRIBUTING.md 9KB
_java.learnMoreAboutCleanUps.md 7KB
_java.notCoveredExecution.md 4KB
Test Plan.md 3KB
USAGE_DATA.md 3KB
_java.metadataFilesGeneration.md 1016B
_java.templateVariables.md 668B
ISSUE_TEMPLATE.md 591B
setTargetPlatform.png 149KB
refactoring_menu.png 98KB
importedMavenProject.png 86KB
ChooseProduct.png 38KB
importMavenProject.png 38KB
importProject.png 36KB
refactoring_change_signature.png 33KB
SocketSteamInVSCode.png 31KB
RemoteServerInVSCode.png 31KB
DebugConfigurationOpen.png 30KB
RemoteServer.png 21KB
ClientPort.png 14KB
DebugRemoteServer.png 12KB
CreateNewConfiguration.png 11KB
statusMarker.png 11KB
icon128.png 10KB
loadingTargetPlatform.png 4KB
reloadTargetPlatform.png 3KB
org.eclipse.jdt.core.prefs 357B
.project 407B
gradle-wrapper.properties 203B
gradle-wrapper.properties 203B
test.properties 0B
.sdkmanrc 112B
extension.ts 41KB
standardLanguageClient.ts 32KB
refactorAction.ts 21KB
sourceAction.ts 17KB
共 179 条
- 1
- 2
资源评论
小兔子平安
- 粉丝: 210
- 资源: 1940
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功