Spring Tools |4
Prerequisite
- Install Java JDK
- Set Environments; PATH, …
// 설치 후 shell에서 자바 버전 확인 $ java -version // change directory @mac $ cd /Library/Java/JavaVirtualMachines/ // JAVA_HOME path 설정 // Shell이 bash인 경우 path 설정 $ vi ~/.bash_profile // 환경 변수 설정 후 jdk 버전 확인 $ java -version
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_311.jdk/Contents/Home
for Eclipse
Settings
- Download jar file
- Unpack jar file
- Executable Folder; <jar filename folder>/contents
- Edit SpringToolSuite4.ini file
- -vm; specify javaw.exe with full path
- -javaagent; add lonbok.jar with full path
- ? -Dosgi.requiredJavaVersion; 1.8? 11?
-startup plugins/org.eclipse.equinox.launcher_1.5.700.v20200207-2156.jar --launcher.library plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.1200.v20200508-1552 -product org.springframework.boot.ide.branding.sts4 --launcher.defaultAction openFile -vm C:/..../java-1.8.0-openjdk-1.8.0.212-1/bin/javaw.exe -vmargs -Dosgi.requiredJavaVersion=1.8 -Dosgi.dataAreaRequiresExplicitInit=true -Xms256m -Xmx2048m --add-modules=ALL-SYSTEM -javaagent:C:\....\lombok.jar
Open Project
- Open Workspace
- Import Project(Package Explorer)
- Select Project Type(Gradle | Maven)
- Browse Project Root Directory
- Check Imported Packages in Package Explorer
- STS4; [Window] → [Show View] → [Project Explorer]
- Change Text File Encoding; [Preferences] → [General > Workspace] →
- Text file encoding; Other: UTF-8
- New text file line delimiter; Oterh: Unix
Run
- [Boot Dashboard]
- select a package & run
Lombok
command line argument
- 실행 시 워크스페이스 지정
C:\ustra\tools\Java\sts-4.7.1.RELEASE\SpringToolSuite4.exe -data C:\Framework-Guide\
for Visual Studio Code
Install Extensions
- Extension Pack for Java by Microsoft
Spring Boot Tools by PivotalSpring Boot Extension Pack by Pivotal
Create Project
- Command Palette (⌘ + ⇧ + P, Ctrl+Shift+P); spring initializr
- Choose One(Add Starters/Create a Gradle Project/Create a Maven Project)
- Specify Spring Boot version;
- Specify prject language; Java / Kotlin / Groovy
- Input Group Id; com.example
- Input Artifact Id; demo
- Specify packaging type; Jar / War
- Specify Java version; 11/ 17 / 8
- Search for dependencies;
- Spring Boot DevTools (*)
- Spring Web (*)
- Choose Directory to make a project