티스토리 뷰

VS Code

VS Code에 Java 개발환경 설정

glshlee 2019. 9. 24. 00:12
반응형

JDK 설치


Download & Install

아래 페이지에서 적당한 JDK를 다운 받아 설치한다.

https://www.oracle.com/technetwork/java/javase/downloads/index.html

 

Java SE - Downloads | Oracle Technology Network | Oracle

Which Java package do I need? Software Developers: JDK (Java SE Development Kit). For Java Developers. Includes a complete JRE plus tools for developing, debugging, and monitoring Java applications. Administrators running applications on a server:  Server

www.oracle.com

JAVA_HOME 설정

mac

Spotlight 검색을 이용해 Terminal을 열고 다음의 명령을 입력하여 현재 설치된 JDK의 목록을 불러온다.

$ /usr/libexec/java_home -V
Matching Java Virtual Machines (3):
    13, x86_64:	"Java SE 13"	/Library/Java/JavaVirtualMachines/jdk-13.jdk/Contents/Home
    1.8.0_121, x86_64:	"Java SE 8"	/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home
    1.7.0_51, x86_64:	"Java SE 7"	/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home

/Library/Java/JavaVirtualMachines/jdk-13.jdk/Contents/Home

이 중에 내가 사용하고자 하는 버전을 JAVA_HOME으로 지정한다.

$ vi ~/.bash_profile

# 다음 내용을 입력하고 저장
export JAVA_HOME=$(/usr/libexec/java_home -v 13) # -v 다음에 버전을 입력한다. ex) 1.7, 1.8, 12, 13

적용을 위해 다음의 명령어를 실행한 뒤 버전이 정상적으로 적용되었는지 확인한다.

$ source ~/.bash_profile
$ java -version
java version "13" 2019-09-17
Java(TM) SE Runtime Environment (build 13+33)
Java HotSpot(TM) 64-Bit Server VM (build 13+33, mixed mode, sharing)

windows

 TBD

VS Code Setting


VS Code에 Java 개발 관련 Plugin 설치

https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-pack

 

Java Extension Pack - Visual Studio Marketplace

OverviewQ & ARating & Review Java Extension Pack Java Extension Pack is a collection of popular extensions that can help write, test and debug Java applications in Visual Studio Code. Check out Java in VS Code to get started. Extensions Included By install

marketplace.visualstudio.com

 

Optional


Maven 설치

Download & Install

https://maven.apache.org/download.cgi#

 

Maven – Download Apache Maven

Downloading Apache Maven 3.6.2 Apache Maven 3.6.2 is the latest release and recommended version for all users. The currently selected download mirror is http://apache.tt.co.kr/. If you encounter a problem with this mirror, please select another mirror. If

maven.apache.org

PATH 설정

bash_profile에 PATH를 추가한다.

$ vi ~/.bash_profile

# 다음 라인 추가
export M2_HOME=/Users/planbsw/tools/apache-maven-3.6.2 # Maven을 압축 해제한 디렉토리
export PATH=$PATH:$M2_HOME/bin

적용을 위해 다음 명령어를 실행한 뒤 버전을 확인해 정상적으로 설정되었는지 확인한다.

$ source ~/.bash_profile
$ mvn -version
Apache Maven 3.6.2 (40f52333136460af0dc0d7232c0dc0bcf0d9e117; 2019-08-28T00:06:16+09:00)
Maven home: /Users/glshlee/tools/apache-maven-3.6.2
Java version: 13, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk-13.jdk/Contents/Home
Default locale: ko_KR, platform encoding: UTF-8
OS name: "mac os x", version: "10.14.6", arch: "x86_64", family: "mac"

git 설치

Download & Install

https://git-scm.com/downloads

 

Git - Downloads

Downloads Mac OS X Windows Linux/Unix Older releases are available and the Git source repository is on GitHub. GUI Clients Git comes with built-in GUI tools (git-gui, gitk), but there are several third-party tools for users looking for a platform-specific

git-scm.com

반응형

'VS Code' 카테고리의 다른 글

VS Code에서 lombok 사용하기  (0) 2020.03.08
VS Code에서 Maven Project 만들기  (0) 2020.03.08
VS Code Markdown preview  (0) 2020.01.04
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/12   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
글 보관함