우분투 SW 저장소에서는 Open-JDK만 설치를 지원한다.

2012.11 현재 Oracle-JDK7 32bit 버전은 저장소에서 지원하는 것으로 확인함.

그러나, 64bit 용은 아래와 같이 수동 설치해줘야 함.


1. 자바(JDK) 다운로드

http://www.oracle.com/technetwork/java/javase/downloads/index.html


※ Ubuntu에서는 rpm 설치를 지원하지 않으니 반드시 리눅스용 tar.gz 파일을 다운로드 할 것.


2. 쉘에서 아래 순서로 진행

$ sudo mkdir -p /usr/lib/jvm/


$ sudo mv 다운로드_JDK_파일명.tar.gz /usr/lib/jvm/


$ cd /usr/lib/jvm/


$ sudo tar zxvf 다운로드_JDK_파일명.tar.gz


$ sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/JDK_폴더명/bin/java" 1


$ sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/JDK_폴더명/bin/javac" 1


$ sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/JDK_폴더명/bin/javaws" 1


3. 테스트

$ java -version


$ javac -version



java 태스크

<target name="run" depends="compile">       

    <java classname="com.some.package.path.BootStrap" 

          classpathref="classpath" 

          fork="true" 

          failonerror="true">

        <jvmarg value="-Dcom.sun.management.jmxremote=true"/>

        <jvmarg value="-Dcom.sun.management.jmxremote.port=9999"/>

        <jvmarg value="-Dcom.sun.management.jmxremote.authenticate=false"/>

        <jvmarg value="-Dcom.sun.management.jmxremote.ssl=false"/>

        <classpath>

            <pathelement path="${dist.dir}/classes"/>

        </classpath>

    </java>

</target>


jar 태스크

<target name="jar" depends="compile">

    <delete>

        <fileset dir="${dist.dir}" includes="output-jar-name.jar"/>

    </delete>

    <jar jarfile="${dist.dir}/output-jar-name.jar">

        <fileset dir="${classes.dir}">

            <include name="com/some/package/path/**/*.class" />

            <include name="com/some/package/path/**/*.xml" />

            <include name="resources/**/*.*" />

        </fileset>

        <manifest>

            <attribute name="Built-By" value="owner"/>

            <attribute name="Main-Class" value="com.some.package.path.BootStrap"/>

            <attribute name="Class-Path" value="

                ../lib/aopalliance-1.0.jar

                ../lib/commons-beanutils-1.6.jar

                ../lib/commons-collections-3.2.jar

                ../lib/commons-configuration-1.8.jar

                ../lib/commons-dbcp-1.2.2.jar

                ../lib/commons-lang-2.6.jar

                ../lib/commons-logging-1.1.1.jar

                ../lib/commons-pool-1.3.jar

                ../lib/ibatis-sqlmap-2.3.4.726.jar

                ../lib/java-gearman-service-0.6.3.jar

                ../lib/log4j-1.2.16.jar

                ../lib/mysql-connector-java-5.1.19.jar

                ../lib/org.springframework.aop-3.1.1.RELEASE.jar

                ../lib/org.springframework.asm-3.1.1.RELEASE.jar

                ../lib/org.springframework.beans-3.1.1.RELEASE.jar

                ../lib/org.springframework.context.support-3.1.1.RELEASE.jar

                ../lib/org.springframework.context-3.1.1.RELEASE.jar

                ../lib/org.springframework.core-3.1.1.RELEASE.jar

                ../lib/org.springframework.expression-3.1.1.RELEASE.jar

                ../lib/org.springframework.jdbc-3.1.1.RELEASE.jar

                ../lib/org.springframework.orm-3.1.1.RELEASE.jar

                ../lib/org.springframework.transaction-3.1.1.RELEASE.jar

                ../lib/slf4j-api-1.6.4.jar

                ../lib/slf4j-log4j12-1.6.5.jar"/>

        </manifest>

    </jar>

</target>


+ Recent posts