230308 풀스택 5일차 - JAVA(인텔리제이)세팅, Git 세팅, JAVA 기초

황인성·2023년 3월 8일
0

https://wiken.io/ken/12051

1강
23 02 20, ken 11970, 1강, 인텔리제이 커뮤니티 에디션 설치 및 세팅

인텔리제이 커뮤니티 에디션 다운로드
다운로드

Community Edition 다운로드

코딩용에 최적화된 폰트 D2Coding 설치
다운로드

D2Coding-Ver1.3.2-20180524.zip

압축해제

D2Coding/D2CodingBold-Ver1.3.2-20180524.ttf 만 설치

인텔리제이, 첫 프로젝트 생성
Language : Java

Build system : Gradle

JDK : Download JDK

correctto-17 Amazon Correctto version 17.0.3

인텔이제이 세팅, 설치직후 한번만 해도 되는 세팅
메뉴 => Help => Edit Custom VM Options

-Dfile.encoding=UTF-8
메뉴 => File => Settings => Appearance & Behavior => Appearance

Font : D2Coding

Size : 본인 시력에 맞게 조정

인텔리제이 UI의 폰트를 정함

메뉴 => File => Settings => Editor => Font

Font : D2Coding

Size : 본인 시력에 맞게 조정

소스코드의 폰트를 조정

메뉴 => File => Settings => Keymap

Keymap : Eclipse

검색 : Rename

Rename File : Alt + Shift + R

Keep

검색 : Find

Find : Ctrl + F

Keep

검색 : Replace

Replace : Alt + Shift + F

Ctrl + F 는 제거

인텔이제이 세팅, 프로젝트 생성시마다 해야하는 세팅
메뉴 => Build, Execution, Deployment => Compiler

Build project automatically : 체크

사실 이 설정은 스프링부트 프로젝트에서만 하면 됩니다.

일반 자바프로젝트에서는 필요없음

메뉴 => Build, Execution, Deployment => Build Tools => Gradle

Build and run using : IntelliJ IDEA

Run tests using : IntelliJ IDEA

Gradle JVM : Project SDK correctto-17

2강
23 02 20, ken 11970, 2강, GIT 설치/세팅, default 브랜치를 main 으로 세팅, .gitignore 세팅, GITHUB PUSH

리포지터리

GIT

GIT 설치
다운로드

GIT 세팅
터미널 접속

git config --global init.defaultBranch main

git config --global user.name "깃허브ID"

git config --global user.email "깃허브이메일"

깃허브에서 Default Branch 를 main 으로
https://github.com/settings/repositories

Repository default branch 를 main 으로 수정 후 Update

원래 main 이라면 패스

깃허브에 리포지터리 생성
https://github.com/new

리포지터리 이름 입력

예를들어

깃허브아이디가 jhs512 이고

예를들어 생성할 리포지터리 이름을 intellij_settings_2023_02_20 라고 세팅한다면

생성된 리포지터리의 주소는 https://github.com/jhs512/intellij_settings_2023_02_20 이다.

img

꼭 체크해제

인텔리제이 자바 프로젝트에 맞는 .gitignore 파일 세팅
https://www.toptal.com/developers/gitignore

https://www.toptal.com/developers/gitignore/api/intellij,java

프로젝트 루트폴더에 .gitignore 파일로 추가

프로젝트에 깃허브 리포지터리 연결
터미널 접속

git init

git remote add origin 리포지터리주소

git remote add origin https://github.com/jhs512/intellij_settings_2023_02_20

git add .

git commit -m "커밋메세지"

git commit -m "work-1"

git push origin main

자바는 컴파일언어
자바스크립트는 인터프리터 언어
System.out.println("Hello world!");
의 . 은 한글로 치면 ~의와 같은 느낌이다.
. 함수명();
. 주어 함수명(); 은 동사
System.out.println(x);
// 시스템의 아웃이(가) 출력해라.
// ~의
// 주어.동사();

개행(줄바꿈)
역슬래쉬() 하고 n 누르면 됨

들여쓰기(오토 리포멧 reformet)
Ctrl+Shift+F

//     a와 b에 각각 값을 할당하고 서로 그 값이 바뀌게 하는 코드를 짜시오
        int a = 5;
        int b = 10;
        int c;
        c = a;
        a = b;
        b = c;
        System.out.println(a);
        System.out.println(b);

출력
10
5

//     문자열과 정수값의 차이 및 출력
        int x = 10;
        System.out.println(x);
        System.out.println("x");
        System.out.println("x" + x);
        System.out.println(x + 10);
        System.out.println("x: " + x * 10);
        System.out.println("x: " + x / 2);
        System.out.println("x: " + (x - 10));

출력
10
x
x10
20
x: 100
x: 5
x: 0

//        사칙연산
        int i = 2;
        System.out.println(i+2);
        System.out.println(i-2);
        System.out.println(i*2);
        System.out.println(i/2);
        System.out.println(i%2);

출력
4
0
4
1
0

문법 형태
if () {} (if 소.괄호 중.괄호 -> if 소 중)
function () {} (function 소.괄호 중.괄호 -> function 소 중)

예제

청년 판별기

        int age = 50;
        System.out.println("당신의 나이 : " + age);

        if (age >= 20) {
            System.out.println("성인 입니다.");
        } else {
            System.out.println("미성년자 입니다.");
        }

        if (age >= 20 && age <= 34) {
            System.out.println("청년 입니다.");
        } else {
            System.out.println("청년이 아닙니다.");
        }

출력
당신의 나이 : 50
성인 입니다.
청년이 아닙니다.

프로그래머스 자바스크립트 입문 30분 타이머 놓고 풀어보기

profile
문제 해결을 위해 끊임없이 파고드는 걸 좋아합니다.

0개의 댓글