/ W3SCHOOLS

W3schools - Intro/Setup

이 페이지는 다음에 대한 공부 기록입니다
Lecture에서 배웠던 내용을 복습하며 작성했습니다

찾으시는 정보가 있으시다면
주제별reference를 이용하시거나
우측 상단에 있는 검색기능을 이용해주세요

Java

programming language

it used for

  • Web, Desktop, Mobile app(specially Android)

  • Web servers and app servers

  • Db connection

  • Games

Start Java

Check Java in windows

  • Search in the start-bar for Java.

  • Type the following in Command Prompt

C:\Users\YourName > java -version
  • If do not have Java, can download at oracle

Step for windows

  1. Go to “System Properties”

    • can be found on

      Control panel>System and security>System>Advanced System Settings

  2. Click on the “Enviroment variables” under the “Advanced tab”

  3. Select the “Path” variable in System variables

  4. Click on “New” and add the Path where Java is installed followed by \bin

    • C:\Program Files\Java\jdk-10\bin
  5. Then “OK” and save settings

Java Quick start

In Java every app begins with class name and that class must match the file name

create “Main.java” file (any text editor)

  public class Main{
    public static void main(String[] args) {
      System.out.println("Hello");
    }
  }

Save file and open cmd

navigate to the directory where saved file and type “javac Main.java”

C:\Users\YourName > javac Main.java

This will compile your code

Type “java main” to run the file

The output should read “Hello”