linux vscode 下开发
- java
- jdk
- 插件
java
jdk
各种JAVA JDK的镜像分发
编程宝库 - 技术改变世界 jdk 镜像
ubuntu22.04 安装
# Linux x64 64位 jdk-8u351-linux-x64.tar.gz
tar -zxf jdk-8u351-linux-x64.tar.gz
mv jdk1.8.0_351 jdk8/
vim ~/.profile
export JAVA_HOME=${HOME}/lang/jdk8
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=$JAVA_HOME/bin:$PATH
. ~/.profile
java -version
maven 下载
wget https://dlcdn.apache.org/maven/maven-3/3.9.4/binaries/apache-maven-3.9.4-bin.tar.gz
tar -zxf apache-maven-3.9.1-bin.tar.gz
mv apache-maven-3.9.1 maven
vim ~/.profile
export MAVEN_HOME=${HOME}/lang/maven
export PATH=$PATH:${MAVEN_HOME}/bin
. ~/.profile
mvn -v
插件
Extension Pack for Java
会包含其他的插件
Getting Started with Java in VS Code
默认是提示要安装 jdk
Java 17 or more recent is required to run the Java extension. Please download and install a recent JDK. You can still compile your projects with older JDKs by configuring ‘java.configuration.runtimes’
指定特定的jdk, 在设置里进行搜索
{"java.jdt.ls.java.home": "/home/wxg/lang/jdk8/"}
设置成功后, 会在插件页提示 This extension is enabled globally.
, 代码也有相应的标志