Java 작업 환경 설치

아현·2021년 3월 3일
0

Java

목록 보기
1/11

1. Java Programming Environment setup

J2SDK Install
(http://www.oracle.com/ visit : download J2SDK and install)

Setting Java Path
:Setting Java Path in System Variable(환경변수: CLASSPATH, JAVA_HOME)
EditPlus Editor install
(www.editplus.com) visit : download and install

-> 다른 에디터 사용 가능

2. Java SE Downloads

(https://www.oracle.com/java/technologies/javase-downloads.html)

3. Setting java Path





For Unix and Linux

• J2SDK를 /usr/local/java 에 설치.
- 만약 C-shell을 사용하면, .cshrc 파일에 환경 변수를 설정.
- 예:


set path=( /usr/local/java/bin $path )
setenv JAVA_HOME /usr/local/java
setenv CLASSPATH .:/usr/local/java/lib/tools.jar setenv LANG ko

- .cshrc 파일을 편집하고, source 명령어를 이용해서 설정을 적용 시킴.
% source ~/.cshrc

4. Edit Plus (Java Environment setting)

에디트 플러스 설치

Tools Setting for javac and java command execution

  • Groups and Tool 에 명령어 삽입
    -Javac
    • NAME : JAVAC
    • COMMAND : C:\Program Files\Java\jdk1.6.0\bin\javac.exe
    • Argument : $(FileName)
    • Initial : $(FileDir)
    -Java
    • NAME : JAVA
    • COMMAND : C:\Program Files\Java\jdk1.6.0\bin\java.exe
    • Argument : $(FileNameNoExt)
    • Initial : $(FileDir)
    -Appletviewer
    • NAME : Appletviewer
    • COMMAND : C:\Program Files\Java\jdk1.6.0\bin\appletviewer.exe
    • Argument : $(FileName)
    • Initial : $(FileDir)


5.1 Taste Java: Lab1

  • Lab : test a java program by using the installed JDK

  • Compile

    	<blockquote>

    C:> javac HelloME.java

    </blockquote>

    -> HelloME.class 파일이 생성됨

  • Execution

    	<blockquote>

    C:> java HelloWorld
    //Hello World

    </blockquote>
  • EditPlus : using javac and java

6. Java API

J2SDK API Documents (SE 14)

(http://www.oracle.com/technetwork/java/index.html)
(http://www.oracle.com/technetwork/java/api-141528.html)
(https://docs.oracle.com/javase/9/docs/api/java/lang/package-summary.html)

J2SDK API Documents (SE 8)

(http://www.oracle.com/technetwork/java/index.html)
(https://docs.oracle.com/javase/8/docs/api/)

5.2 Taste Java: Lab2

  • Lab : print the name and department of each student by using StringBuffer class



[Common mistakes for beginners]

• Java distinguishes the capital letter and the small letter
• Does not work well in directories with Korean names
• Java environment variables must be set correctly
• Need to run the class with main()
• If there is a class declared as public, the file name must be the same as the class name.
• It is better not to create a class with the same name as the class name provided by J2SDK.
• It is impossible to remember all of the many classes and methods of the Java language.
• In the Java language, there are rules for naming classes or methods.
- Class names are appended with an English noun form and start with a capital letter.
• When using multiple words, do not use "" for new words and start with a capital letter.
• Example: Car, ChattingServer
- Method names begin with a lowercase letter as a verb form
• When multiple words are used, and the beginning word is capitalized.
• Example: getName(
)_, setLabel()
- Member names start with a lowercase letter

profile
Studying Computer Science

0개의 댓글