3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Windows & VS Code で Java12 + Junit5 の環境を作る

3
Last updated at Posted at 2019-04-03

必要なモノ

apache-maven-[version]-bin.zip
openjdk-12_windows-x64_bin
をダウンロードして展開する。

最終的にこんな配置にしたい

C:/
├ java
│ ├ apache-maven-[version]
│ └ jdk-12
│
└ workspace
  └ javaProj
     ├ src
     │ ├ main/java
     │ └ test/java
     └ pom.xml

path通すのを忘れずに
JAVA_HOMEC:/java/jdk-12
MAVEN_HOMEC:/java/apache-maven-[version]
PATH に追加もしておくこと

VS Code

拡張機能

  • Java Extension Pack

これインストールしておけばOK

setting.json

コマンドパレットでPreferences: Open Settings ((UI)じゃない方) を開く
"java.home": "C:\\java\\jdk-12"を追加

junit5

ここの pom.xml をコピーして

project > properties > java.version12に変更

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<!-- 略 -->
	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<java.version>12</java.version>
		<junit.jupiter.version>5.2.0</junit.jupiter.version>
		<junit.platform.version>1.2.0</junit.platform.version>
	</properties>
	<!-- 略-->
</project>

cmd とか WPS で 下のコマンド実行

> cmd /c mvn install -f "c:\workspace\javaProj\pom.xml"

準備完了

あとは Junit公式 のドキュメント読んでテストを書けば良いと思う。

3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?