VisualStudio Code의 셋업파일을 더블클릭하여 설치 후 

Extension을 추가로 설치할 것이다.

 

이런식으로 설치 후 제거가 보이면 설치가 완료된 것이다.

 

 

 

 

 

 

이렇게 우선 총 5개를 설치하였다.

Korean, Prettier, Open in browser, indent-rainbow, Auto Rename Tag

 

깃 설치 중에

 

 

이 부분이 master 에서 main으로 바뀌고 있는 추세인데 이것만 체크하고 나머지는 모두 Next 한 후 설치

 

아파치도 압축을 해제한 후 폴더 그대로 C드라이브로 옮긴다.

 

해당 폴더의 bin에 들어가서 폴더 경로를 복사후

cmd에서 cd + 경로 후

startup하면 아래와 같은 창이 열린다.

1080은 1.08초 시간이 들었다는 것이다.

한글

 

 

그 후 localhost:8080 으로 들어갔을때 이 화면이 나오면 잘 작동되는 것이다.

 

 

이제 마지막으로 STS를 설치할 것인데

 

압축파일 안에서 이것을 꺼내어 C드라이브로 옮겨주면 된다.

 

STS런처를 실행한다.

 

이 화면이 나오면 성공이다.

 

File -> New -> Spring Legacy Project

 

아래에 템플릿이 다 보이지 않는다면

Configure templates 클릭

가운데 것을 제외 하고 두가지를 Remove 한 후 Apply and Close하면 생긴다고 하는데 필자는 되지 않아서

몇시간 동안 찾아본 결과

 

몇년 전부터 이 기능을 이제 지원하지 않는다 한다.

따라서 기존에 빈프로젝트를 만들어 놓은 것을 임포트 해야 한다고 한다.

 

 

이러면 생성된다. 아래의 폴더를 설치하자(압축해제X)

firstSpring.zip
0.02MB

 

이렇게 잘 만들어짐을 확인할 수 있다.

 

만약 이렇지 않고 원할하게 MVC project를 생성했을 경우

여기에 이런식으로 넣어주면

 

이렇게 패키지 이름이 만들어진다.

 

 

이제 서버를 연결해줄 것이다.

이 아래 버튼을 누르고 tomcat검색후 설치했던 9버전 next

 

 

그 후 Finish 하면 완료가 되어 있는 상태

 

 

 

 

이제 서버를 실행 시켜 볼 것 이다.

 

한글은 현재 깨지고 현재 시간이 출력된다.

 

외부 브라우저로 변경할 것이다.

돋보기를 클릭

 

web browser 선택후 external로 변경 후 chrome을 클릭후 apply

 

그리고 다시 Run on Server를 하면 Chrome으로 실행됨을 확인 할 수 있다.

https://jdk.java.net/archive/

 

Archived OpenJDK GA Releases

Archived OpenJDK General-Availability Releases This page is an archive of previously released builds of the JDK licensed under the GNU General Public License, version 2, with Classpath Exception. WARNING: These older versions of the JDK are provided to he

jdk.java.net

 

개인의 컴퓨터에 맞게 버전을 설치해 줄 것인데,

필자는 11.0.2 윈도우 버전을 설치했다.

 

스프링으로 개발하기 위해 필요한 도구들

자바 개발 도구 : Java11

통합개발 환경 : STS, IntelliJ(Ultimate 유료버전만)

웹 서버 : Tomcat 9

웹 브라우저 : Chrome

데이터 베이스 : MySQL 5.7

기타 : VS code, Git, AWS, Maven

 

우선 STS를 설치할 것이다.

https://github.com/spring-attic/toolsuite-distribution/wiki/Spring-Tool-Suite-3

 

Spring Tool Suite 3

the distribution build for the Spring Tool Suite and the Groovy/Grails Tool Suite - spring-attic/toolsuite-distribution

github.com

 

 

IntelliJ 유료 설치(30일 무료)

https://www.jetbrains.com/ko-kr/idea/download/?section=windows

 

최고의 Java 및 Kotlin IDE인 IntelliJ IDEA를 다운로드하세요

 

www.jetbrains.com

 

Tomcat 9 다운로드

톰캣은 EE에 포합된다(Enterprise Edition)

https://tomcat.apache.org/download-90.cgi

 

Apache Tomcat® - Apache Tomcat 9 Software Downloads

Welcome to the Apache Tomcat® 9.x software download page. This page provides download links for obtaining the latest version of Tomcat 9.0.x software, as well as links to the archives of older releases. Unsure which version you need? Specification version

tomcat.apache.org

 

 

VisualStudio Code 설치

https://code.visualstudio.com/download

 

Download Visual Studio Code - Mac, Linux, Windows

Visual Studio Code is free and available on your favorite platform - Linux, macOS, and Windows. Download Visual Studio Code to experience a redefined code editor, optimized for building and debugging modern web and cloud applications.

code.visualstudio.com

 

Git 다운로드

https://git-scm.com/downloads

 

Git - Downloads

Downloads macOS Windows Linux/Unix Older releases are available and the Git source repository is on GitHub. Latest source Release 2.47.0 Release Notes (2024-10-06) Download Source Code GUI Clients Git comes with built-in GUI tools (git-gui, gitk), but ther

git-scm.com

 

 

for문은 단순해 보이나 중요한 것이 있다.

for문이 돌아가는 순서에 대해서 이다.

 

초기식 -> 조건식 -> 증감식 순이 아닌

초기식 -> 조건식 -> 중괄호 안에 있는 문 -> 증감식 순으로 이어진다.

 

위의 잘못된 로직으로 생각할 시 코딩을 했을 때

마지막 변수가 출력되지 않은 적을 다들 경험해 봤을 것이다.

필자 또한 그런 경험이 있다.

 

 

 

아래 코드에서 주석 처리 된 부분은 일반적인 for문인데

자바에서는 아래와 같이 향상된 for문을 이용하여

코드의 길이를 줄일 수 있다.

 

public class ForLoopTest {
    public static void main(String[] args) {
        int[] numbers = {1,2,3,4,5,6,7,8,9,10};

//        for(int i=0; i<numbers.length; i++){
//            System.out.println(numbers[i]);
//        }
        //foreach문 (향상된 for문)
        for(int su : numbers){
            System.out.println(su);
        }
    }
}

+ Recent posts