You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
在 VS Code 上安装 Java 拓展插件包:Java Extension Pack (可以不装这个插件包,只安装 Language Support for Java(TM) by Red Hat ,但是不建议这样做),安装该插件包会包含以下 4 个拓展插件:
Language Support for Java(TM) by Red Hat (运行 Java 代码插件,其他插件都可不装这个必装)
Debugger for Java (用作调试)
Java Test Runner (用作单元测试)
Maven for Java ( Maven 是在 Java 环境下构建应用程序的软件)
除此之外,还建议安装以下拓展插件:
Java Dependency Viewer (Manage Java Dependencies(依赖) in VSCode)
Spring Boot Extension Pack(A collection of extensions for developing Spring Boot applications),现代 Java 项目少不了 Spring 框架,所以建议安装这个拓展包。该拓展包含了 Spring Initializr Java Support(用于生成快速启动的Spring Boot Java项目)在内的几个插件。
Build path specifies execution environment J2SE-1.5. There are no JREs installed in the workspace that are strictly compatible with this environment.
The compiler compliance specified is 1.5 but a JRE 1.8 is used
/Library/apache-maven-3.8.4/bin/mvn.cmd: line 1: syntax error near unexpected token (' /Library/apache-maven-3.8.4/bin/mvn.cmd: line 1: @Rem Licensed to the Apache Software Foun'ation (ASF) under one
环境:
一、安装 Maven
这里使用 Homebrew 安装 Maven ,也可以从官网下载安装:https://maven.apache.org
二、VS Code 安装 Java 拓展插件
在 VS Code 上安装 Java 拓展插件包:Java Extension Pack (可以不装这个插件包,只安装 Language Support for Java(TM) by Red Hat ,但是不建议这样做),安装该插件包会包含以下 4 个拓展插件:
除此之外,还建议安装以下拓展插件:
三、创建 Maven 项目
这一步建议使用“梯子”加速,不然可能会卡在"Generating project in Interactive mode"。
关于 groupId 和 artifactId 的命名,参考:Maven项目命名规范:
cn.marchone
,在.java
文件顶部就要这样写:package cn.marchone;
maven-test
进行命名。如果 VS Code 终端中输出以下的类似问题:
需要在 pom.xml 中添加下面 2 行代码指定版本:
The text was updated successfully, but these errors were encountered: