LetMeLove 의 세상보기

  • 표지
  • 지역로그
  • 태그
  • 방명록

'공부좀 합시다/JAVA/JSP'에 해당되는 글 4건

  1. 2007/04/05 LetMeLove javac 옵션과 java옵션
  2. 2007/03/12 LetMeLove Why Java ME Platform?
  3. 2007/03/12 LetMeLove Java SE Overview
  4. 2007/03/12 LetMeLove SDK, JDK, J2SDK, J2SE, J2EE, J2ME, JRE 용어정리

javac 옵션과 java옵션

공부좀 합시다/JAVA/JSP 2007/04/05 19:59 LetMeLove

자바 컴파일과 실행 에 사용되어지는 javac, java 명령어의 옵션 을 다음과 같이 정리하였습니다.


javac - 자바컴파일러로써, 자바코드를 작성한 소스파일(.java)을 자바 가상머신이 인식할수 있는 바이트 코드(.class)
타입으로 변환시켜주는 명령어 입니다.

사용법: javac <options> <souce files>
예를들어, Hello.java, Greeting.java 두개의 파일이 존재한다면,
javac Hello.java Greeting.java
javac *.java (*을 사용해서, 모든 확장자가 .java인 파일을 컴파일할수 있다.)

1) 옵션:


a) -classpath:

-classpath(cp) path(파일 절대 경로):
컴파일러가 컴파일 하기 위해서 필요로 하는 참조할 클래스 파일들을 찾기 위해서 컴파일시 파일 경로를 지정해주는
옵션. 예를 들어,  Hello.java파일이 C:\Java 디렉터리에 존재하고, 필요한 클래스 파일들이 C:\Java\Engclasses에 위치한다면,
javac -classpath C:\Java\Engclasses C:\Java\Hello.java 로 해주면 된다. 만약 참조할 클래스 파일들이 C:\Java\Engclasses외의
다른 디렉터리에도 존재한다면, C:\Java\Korclasses 일경우,
javac -classpath C:\Java\Engclasses;C;\Java\Korclasses C:\Java\Hello.java
그리고, 현재 디렉터리역시 포함하고 싶다면,
javac -classpath .;C:\Java\Engclasses;C;\Java\Korclasses C:\Java\Hello.java
기본적으로, dos에서는 .는 현재 디렉터리를 의미하고, ..는 현재 디렉터리의 상위디렉터리를 의미한다.
또한 classpath 대신 단축어인 cp를 사용해도 된다.
javac -cp C:\Java\Engclasses C:\Java\Hello.java 

b) -d:
-d directory
클래스 파일을 생성할 루트 디렉터리를 지정합니다.
기본적으로 컴파일러는 -d옵션을 주지 않으면, 소스파일이 위치한 디렉터리에 클래스 파일을 생성시킵니다.
예를 들어,  Hello.java파일이 C:\Java 디렉터리에 존재하고 클래스 파일의 루트디렉터리를 C:\Java\Classfiles라고 하면,
javac -d C:\Java\Classfiles C:\Java\Hello.java 입니다.

만약 -d 옵션을 사용하려고 하는데, 루트디렉터리(위예에서는 C:\Java\Classfiles) 가 존재 하지 않는다면,
"The system cannot find the path specified"라는 에러 메시지를 보게 됩니다.
현재 작업 디렉터리가 C:\Java\Classfiles 에 위치하면,
javac -d .\Classfiles Hello.java 와 같이 상대 디렉터리로 표현할수 있습니다.

java class내에서 package를 선언한 경우 package별 폴더를 생성하고 해당 폴더에(package) compile한다.

c) -encoding:
-encoding encoding name
소스 파일에 사용된 문자열 인코딩을 설정합니다.
만약 위옵션이 설정되어 있지 않으면, 플래폼의 기본적인 컨버터가 사용되어 집니다.

d) -g:
모든 디버깅 정보를 생성시킵니다.
만약 위옵션이 설정되어 있지 않으면, 기본적으로, 라인넘버만 생성시킵니다.
-g:none: 디버깅 정보를 전혀 생성 시키지 않습니다.
-g:{lines, vars, source}:
위처럼 명시적으로, 몇몇 디버깅 정보를 생성시킬수 있습니다.
lines은 라인정보, vars는 지역변수, sounce는 소스 파일 정보를 나타냅니다.

e) -nowarn:

경고 메시지 (warning message)를 생성시키지 않습니다.

f) -verbose:

컴파일러와 링커가 현재 어느 소스파일이 컴파일되고 있고, 어느 파일이 링크되고 있는지
그정보를 출력한다.

h) -deprecation:

소스 코드내에서, 사용되어진 deprecated API의 위치 를 출력 합니다.

ex)
C:\Java> javac World.java
Note: World.java uses a deprecated API. Recompile with "-deprecation" for details
.
1 warning
C:\Java> javac -deprecation World.java
World.java:52: Note: The method java.awt.Dimension size() in class java.awt.Compon
ent has been deprecated.
Dimension d = size();

Note: World.java uses a deprecated API. Please consult the documentation for a be
tter alternative.

i) -sourcepath:

-sourcepath 소스패스

소스파일의 위치를 지정합니다.

j) -target:

-target 자바버젼

지정된 자바버젼의 VM에서 작동 되어지도록 클래스파일을 생성 시킵니다.

1.1
jvm 1.1 버젼에서 호환되어질수 있는 클래스 파일생성
1.2
jvm 1.2 버젼에서 호환되어질수 있는 클래스 파일생성
1.3
jvm 1.3 버젼에서 호환되어질수 있는 클래스 파일 생성

ex)

javac -target 1.2 Helloworld.java

k) -bootclasspath 패스:

특정한 bootstrap또는 확장 클래스를 지정할수 있다.
기본적으로, 자바컴파일러는 javac(컴파일러명령)이 설치된 플래폼의 bootstrap과 확장클래스들을 통해서, 컴파일작업을 수행하지만,
bootclasspath 옵션을 사용하면, cross-compiling이라고 해서, 다른 자바플래폼의 bootstrap과 확장클래스들을 통해서, 컴파일 할수 있는 기능을 지원한다.
예를들어,
javac -target 1.1 -bootclasspath jdk1.1.7/lib/classes.zip -extdirs "" OldCode.java
컴파일러에게 현재 자신의 bootstrap을 사용하지 말고, jdk1.1.7/lib/classes.zip bootstrap클래스들을 사용해서 컴파일 하라고
명령하는것이다.
참고로, 모바일자바에서, 모바일폰에 설정된, jvm에 맞도록, 소스코드를 컴파일하기 위해서, 주로 사용되어지는 옵션이다.

l) -extdirs 디렉터리:
특정한, 확장 디렉토리를 지정한다.cross-compiling시 주로, 사용되어지는 옵션이면, 각디렉터리들은 콜론(:)에 의해서, 분리되어진다.
컴파일시, 기술한 디렉터리의 클래스 파일을 참조한다.

========================================================

출처 : http://blog.naver.com/darkhan1?Redirect=Log&logNo=10009423507

java 컴파일시 알아 두면 유용하게 쓰일거 같다..

###################################################################

###################################################################

Usage: javac <options> <source files>
where possible options include:
  -g                                  Generate all debugging info
  -g:none                          Generate no debugging info
  -g:{lines,vars,source}     Generate only some debugging info
  -nowarn                         Generate no warnings
  -verbose                        Output messages about what the compiler is doing
  -deprecation                   Output source locations where deprecated APIs are used
  -classpath <path>           Specify where to find user class files and annotation processors
  -cp <path>                     Specify where to find user class files and annotation processors
  -sourcepath <path>         Specify where to find input source files
  -bootclasspath <path>      Override location of bootstrap class files
  -extdirs <dirs>                Override location of installed extensions
  -endorseddirs <dirs>       Override location of endorsed standards path
  -proc:{none,only}            Control whether annotation processing and/or compilation is done.
  -processor <class1>[,<class2>,<class3>...]

                                      Names of the annotation processors to run; bypasses default discovery process
  -processorpath <path>      Specify where to find annotation processors
  -d <directory>                 Specify where to place generated class files
  -s <directory>                 Specify where to place generated source files
  -implicit:{none,class}      Specify whether or not to generate class files for implicitly referenced files
  -encoding <encoding>       Specify character encoding used by source files
  -source <release>          Provide source compatibility with specified release
  -target <release>            Generate class files for specific VM version
  -version                         Version information
  -help                             Print a synopsis of standard options
  -Akey[=value]                Options to pass to annotation processors
  -X                                 Print a synopsis of nonstandard options
  -J<flag>                         Pass <flag> directly to the runtime system
 
 
 
 
Usage: java [-options] class [args...]
          (to execute a class)
  or  java [-options] -jar jarfile [args...]
          (to execute a jar file)

where options include:
   -client   to select the "client" VM
   -server   to select the "server" VM
   -hotspot   is a synonym for the "client" VM  [deprecated]
                 The default VM is client.
                
   -cp <class search path of directories and zip/jar files>
   -classpath <class search path of directories and zip/jar files>
                 A ; separated list of directories, JAR archives, and ZIP archives to search for class files.
   -D<name>=<value>
                 set a system property
   -verbose[:class|gc|jni]
                 enable verbose output
   -version      print product version and exit
   -version:<value>
                 require the specified version to run
   -showversion  print product version and continue
   -jre-restrict-search | -jre-no-restrict-search
                 include/exclude user private JREs in the version search
   -? -help      print this help message
   -X            print help on non-standard options
   -ea[:<packagename>...|:<classname>]
   -enableassertions[:<packagename>...|:<classname>]
                 enable assertions
   -da[:<packagename>...|:<classname>]
   -disableassertions[:<packagename>...|:<classname>]
                 disable assertions
   -esa | -enablesystemassertions
                 enable system assertions
   -dsa | -disablesystemassertions
                 disable system assertions
   -agentlib:<libname>[=<options>]
                 load native agent library <libname>, e.g. -agentlib:hprof
                   see also, -agentlib:jdwp=help and -agentlib:hprof=help
   -agentpath:<pathname>[=<options>]
                 load native agent library by full pathname
   -javaagent:<jarpath>[=<options>]
                 load Java programming language agent, see java.lang.instrument
   -splash:<imagepath>
                 show splash screen with specified image
 

M) package 선언된 Java class 실행시키기

- package위치는 CLASSPATH 하위 폴더부터로 인식한다. 따라서 Package폴더의 Root가 ClassPath에 지정되든지

.(현위치)를 ClassPath에 등록 후 현 위치 아래서부터 package의 위치를 지정한다.

java package.class명 (현위치 아래에 package폴더가 존재)

java com.test.SampleMain

크리에이티브 커먼즈 라이센스
Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
2007/04/05 19:59 2007/04/05 19:59
TAG java, javac
받은 트랙백이 없고, 댓글이 없습니다.

댓글+트랙백 RSS :: http://letmelove.net/blog/rss/response/52

트랙백 주소 :: http://letmelove.net/blog/trackback/52

트랙백 RSS :: http://letmelove.net/blog/rss/trackback/52

댓글을 달아 주세요

댓글 RSS 주소 : http://letmelove.net/blog/rss/comment/52
[로그인][오픈아이디란?]

Why Java ME Platform?

공부좀 합시다/JAVA/JSP 2007/03/12 18:43 LetMeLove

Java ME Platform represents the only truly open solution for building mobile applications for the industry. The technology allows portability of applications between platforms and investments are kept to a minimum through the possibility of reuse. The continuous platform evolution is driven by the increasing demands for capabilities and performance in the industry and assured through the definition of the platform components and APIs in the Java Community Process. The fact that the technology is open for anyone to use the community of developers creating applications for the platform is large and increasing. This assures the continuous improvement and availability of applications for the platform which in turn drives business for everybody involved in the eco-system. On top of this the platform itself represents a high performance and secure platform for mobile applications.

The Java ME technology ecosystem evolves around a number of different players in the industry, all of them participating in , and influencing, the continuous improvement of the technology and platform. The end users are constantly demanding new features and capabilities to their services. The content developers adopts the user requirements and creates new appealing services with new capabilities. The OEMs creates new capable devices to host the new services and features and also creates new demands by presenting new capabilities to the end users. Carriers creates the mobile environment to host and deploy services on and also drives the exploration of new business-driving services to the end users. This constant evolution of demands and capabilities is the single most important reason for the success of the Java platform and ensures it will continue to evolve into the future needs of everyone involved in the eco-system.

Java Mobile Eco-System
Java Mobile Eco-System

Java ME platform consist of a number of specified components. It has been defined, and are continuously improved and developed, by the industry through the Java Community Process. This ensures the ongoing evolution and adoption of the platform by inviting all players in the industry to participate in the definition of the platform and it's capabilities.

크리에이티브 커먼즈 라이센스
Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
2007/03/12 18:43 2007/03/12 18:43
TAG java, ME
받은 트랙백이 없고, 댓글이 없습니다.

댓글+트랙백 RSS :: http://letmelove.net/blog/rss/response/47

트랙백 주소 :: http://letmelove.net/blog/trackback/47

트랙백 RSS :: http://letmelove.net/blog/rss/trackback/47

댓글을 달아 주세요

댓글 RSS 주소 : http://letmelove.net/blog/rss/comment/47
[로그인][오픈아이디란?]

Java SE Overview

공부좀 합시다/JAVA/JSP 2007/03/12 18:33 LetMeLove

Java SE Overview


There are two principal products in the Java SE platform family: Java SE Runtime Environment (JRE) and Java Development Kit (JDK).

Java Runtime Environment (JRE)
The Java Runtime Environment (JRE) provides the libraries, the Java Virtual Machine, and other components to run applets and applications written in the Java programming language. In addition, two key deployment technologies are part of the JRE: Java Plug-in, which enables applets to run in popular browsers; and Java Web Start, which deploys standalone applications over a network. It is also the foundation for the technologies in the Java 2 Platform, Enterprise Edition (J2EE) for enterprise software development and deployment. The JRE does not contain tools and utilities such as compilers or debuggers for developing applets and applications.

Java Development Kit (JDK)
The JDK is a superset of the JRE, and contains everything that is in the JRE, plus tools such as the compilers and debuggers necessary for developing applets and applications. The conceptual diagram above illustrates all the component technologies in Java SE platform and how they fit together.

크리에이티브 커먼즈 라이센스
Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
2007/03/12 18:33 2007/03/12 18:33
TAG java, SE
받은 트랙백이 없고, 댓글이 없습니다.

댓글+트랙백 RSS :: http://letmelove.net/blog/rss/response/46

트랙백 주소 :: http://letmelove.net/blog/trackback/46

트랙백 RSS :: http://letmelove.net/blog/rss/trackback/46

댓글을 달아 주세요

댓글 RSS 주소 : http://letmelove.net/blog/rss/comment/46
[로그인][오픈아이디란?]

SDK, JDK, J2SDK, J2SE, J2EE, J2ME, JRE 용어정리

공부좀 합시다/JAVA/JSP 2007/03/12 18:26 LetMeLove

자바를 공부하시는분들이 용어를 많이 헷깔려 하더군요...

저역시 그랬구요...

그래서 정리 한번 해봅니다.

자바를 공부하는 사람으로서 꼭 알아야 하는 간단한 용어 몇가지입니다^^


SDK => Standard Development Kit 혹은 Software Development Kit

위의 두가지 표현 모두 맞다고 보시면 됩니다.

어떻게 사용하고, 어떻게 해석하는가에 따라 다르지만 내용은 비슷합니다.

SDK는 자바뿐만아니라 모든 개발언어의 소프트웨어 개발 킷을 말합니다.

프로그램을 개발하려면 개발하는 프로그램이 있어야 겠죠? 그것을 말합니다^^


JDK => Java Development Kit

위에 설명한 SDK가 모든 소프트웨어 개발 킷이라면...  JDK는 말그대로 JAVA 개발 킷을 말합니다. 즉, Java용 SDK의 이름이 JDK라고 표현할수 있죠.

그런데 요즘들어 J2SE Development Kit라고 표현되있는것을 볼수있습니다.

이것은 J2SE의 JDK를 다운받을때 볼수 있는데요...

java.sun.com 홈페이지에 가보면... sun에서는 J2SE의 경우 jdk라 표현하며... 이때 J2SE Development Kit라고 되있습니다. 그리고 J2EE의 경우 j2eesdk라고 되있더군요.

즉, 최근 sun에서는 J2SE의 개발킷을  jdk라고 표현하며... J2EE의 개발킷은 j2eesdk라고 표현하더군요.


J2SDK => Java2 Standard Development Kit 혹은 Java2 Platform Standard Development Kit

위에 JDK설명에서 보시듯이 요즘 J2SE의 개발킷을 JDK라 표현하는데요...

예전에 java2 platform이 출시되었을 당시 java1과 구분하기위해  J2SDK라고 표현 했습니다.

즉, 현제는 java2 platform만 사용하기 때문에 JDK와 동일하다고 보시면 됩니다.


J2SE => Java 2 Standard Edition 혹은  Java2 Platform Standard Edition

J2SE는 말그대로 java의 표준 플렛폼 입니다.


J2ME => Java 2 Micro Edition혹은  Java2 Platform Micro Edition

J2ME는 규모가 작은곳에 프로그램을 개발하기 위한 플렛폼 입니다.

예를들면 PDA를 들수있죠^^


J2EE => Java 2 Enterprise Edition혹은  Java2 Platform Enterprise Edition

J2EE는 웹기반의 엔터프라이즈 어플리케이션을 구축하기 위한 플렛폼 입니다.

대표적으로 EJB가 있죠^^


JRE => J2SE Runtime Environment

JRE는 실행버젼입니다. JDK로 제작한 테스트 프로그램등을 실행할수 있도록 해주죠.

그래서 파일용량이 적은대신 개발할수는 없습니다.

크리에이티브 커먼즈 라이센스
Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
2007/03/12 18:26 2007/03/12 18:26
TAG j2ee, j2me, j2sdk, j2se, java, jre, SDK
받은 트랙백이 없고, 댓글이 없습니다.

댓글+트랙백 RSS :: http://letmelove.net/blog/rss/response/45

트랙백 주소 :: http://letmelove.net/blog/trackback/45

트랙백 RSS :: http://letmelove.net/blog/rss/trackback/45

댓글을 달아 주세요

댓글 RSS 주소 : http://letmelove.net/blog/rss/comment/45
[로그인][오픈아이디란?]

◀ 이전페이지 1 다음페이지 ▶

블로그 이미지
살아 있다는건.. 끊임없는 처음과의 만남 LetMeLove
  • 광고 목적의 댓글 및 트...
  • 관리자
  • 글쓰기

달력

«   2012/05   »
일 월 화 수 목 금 토
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    

카테고리

  • 전체 (99)
    • 전체 (0)
    • 사진으로 보는세상 (9)
    • 세상사는 이야기 (8)
    • 공부좀 합시다 (51)
      • Html/Css (3)
      • PHP (8)
      • JAVA/JSP (4)
      • JavaScript (5)
      • MySQL (7)
      • Oracle (1)
      • Linux / Unix (18)
      • Ajax / Flax (0)
      • 기타 (5)
    • 취미생활 (16)
      • 애니메이션 (10)
      • 기타 (6)
    • IT 트랜드 (15)
      • 뉴스 (12)
      • 리뷰 (3)

태그목록

  • window
  • 프린터
  • network
  • 마이 SQL
  • 방화벽
  • 순천
  • SE
  • my.cnf
  • 물의 증거
  • 톰켓
  • 카린증혈기
  • 금연
  • M&A
  • ping
  • apache2
  • ORM
  • shutdown
  • freetds
  • 시간대
  • 컴파일
  • CP1215
  • 사쿠라
  • 아쿠아플러스
  • 우동 한 그릇
  • ME
  • Santa Rosa
  • register_globals
  • windows
  • IE6
  • 드라마촬영지

최근에 올라온 글

  • Centos6 에서 외부로 라우....
  • 아파치+톰켓*2 사용시 도....
  • SSH 접속시 지연현상 해결.... (1)
  • PHP ORM - ADODB Acvite R.... (1)
  • PHP ORM Propel 윈도우 설치.

최근에 달린 댓글

  • 대단히 감사합니다! 아주 좋.... Louis vuitton handbags 05/19
  • 대단히 감사합니다! 아주 좋.... Breitling replica 05/18
  • 무작정 max_connection 만 늘.... LetMeLove 03/20
  • 집에서 연습하고 있는데 RHEL.... 캄사 ㅠㅠ 2011
  • 감사합니다~. 감사 2011

최근에 받은 트랙백

  • spaceufo의 생각. spaceufo's me2DAY 2008
  • activeX의 문제점... b o g n i 2007

링크

  • Flex / Air 한글화문서.
  • MSDN.
  • MySQL.
  • NetCraft.
  • NewType Korea 이글루지부.
  • NHN UI Dev.
  • ORACLE.
  • PHP.
  • PHP SCHOOL.
  • PrimitiveStudio.
  • SourceForge.
Textcube
Creative Commons License

이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
  • Total : 207863
  • Today : 65
  • Yesterday : 65

지역로그 : 태그 : 방명록 : 관리자 : 글쓰기
LetMeLove’s Blog is powered by Textcube 1.6.1 : Arpeggio / Designed by plyfly.net