728x90
1. 아래와 같은 내용으로 HelloWorld.java 라는 파일을 만든다.
class HelloWorld {
public static void main(String[] args) {
System.out.println("HelloWorld!");
}
}
2. javac HelloWorld.java
문제가 없으면 HelloWorld.class 라는 파일이 생성됨.
3. javac cfe helloworld.jar HelloWorld HelloWorld.class
helloworld.jar 파일이 생성되고 java -jar helloworld.jar를 실행하면
HelloWorld! 라고 출력이 됨.
javac cfe <jar 파일명> <클래스 이름> <*.class 파일명>
728x90
'Research > Programming' 카테고리의 다른 글
/bin/sh: 1: Syntax error: Bad fd number (0) | 2013.01.19 |
---|---|
cross compile configure시에 build, host, target option (0) | 2012.10.29 |
fflush(stdin)? __fpurge(stdin)! (0) | 2012.02.10 |
sqlite 파일, 테이블, 쿼리, 업데이트 (0) | 2011.05.18 |
pthread_cond_wait (0) | 2011.05.11 |