• 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
-> 다른 에디터 사용 가능
(https://www.oracle.com/java/technologies/javase-downloads.html)
• J2SDK를 /usr/local/java 에 설치.
- 만약 C-shell을 사용하면, .cshrc 파일에 환경 변수를 설정.
- 예:
- .cshrc 파일을 편집하고, source 명령어를 이용해서 설정을 적용 시킴.
set path=( /usr/local/java/bin $path )
setenv JAVA_HOME /usr/local/java
setenv CLASSPATH .:/usr/local/java/lib/tools.jar setenv LANG ko
% source ~/.cshrc
Compile
<blockquote>
C:> javac HelloME.java
</blockquote>
-> HelloME.class 파일이 생성됨
Execution
<blockquote>
C:> java HelloWorld
//Hello World
</blockquote>
EditPlus : using javac and java
(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)
(http://www.oracle.com/technetwork/java/index.html)
(https://docs.oracle.com/javase/8/docs/api/)
• 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