Java Web Start를 사용하여 Eclipse 기반 응용프로그램 배치

Eclipse 3.1에서 빌드된 응용프로그램은 이제 Java Web Start를 사용하여 배치할 수 있습니다.

Java Web Start는 "웹 브라우저에서 한 번 클릭하는 것만으로 전기능의 응용프로그램을 실행할 수 있는 능력을 제공하는 응용프로그램 배치 기술"입니다.

Java Web Start를 통해 Eclipse를 시작하기 위한 전제조건은 다음과 같습니다.

다음 단계는 기능 기반 RCP 응용프로그램에 서비스를 제공하는 Java Web Start 사이트의 설정 방법에 대해 설명합니다.

1 단계: 랩퍼링 기능 작성

2 단계: 랩퍼링 기능 및 startup.jar 내보내기

주의하십시오. 이 단계로 진행하기 전에 사용 가능한 키 스토어가 있는지 확인하십시오. Eclipse는 키 스토어를 작성할 수 있는 기능을 제공하지 않습니다. 키 도구를 사용해야 합니다. 또한 개발 중인 Eclipse가 JRE 대신 Java SDK에서 실행 중인지 확인하십시오. 이 제한조건을 만족시키지 못하면 jar 서명에 실패합니다.

3 단계: 기본 jnlp 파일 작성

Java Web Start 응용프로그램은 JNLP 파일에 설명됩니다. 이 파일은 어느 정도 동일한 메커니즘으로 eclipse.exe 및 config.ini 파일을 대신합니다. 예를 들어, JNLP에는 매개변수를 전달하고 응용프로그램 구성 내용을 정의하기 위한 방법인 스플래시 화면을 제어하는 고유한 메커니즘이 있습니다.

내보낸 경우, 모든 단순 JNLP 파일이 작성되었으므로 사용자는 응용프로그램을 제어할 기본 파일만 작성하면 됩니다. 대부분의 기본 파일은 모든 응용프로그램에 공통되므로 다음과 같은 자체 문서화 템플리트를 통해 시작하도록 합니다.

응용프로그램에 서비스를 제공하는 사이트에서, 파일은 startup.jar과 같은 폴더에 있어야 합니다. 이 파일을 편집하고 나면 응용프로그램을 사용할 준비가 완료됩니다.

<?xml version="1.0" encoding="UTF-8"?>
<jnlp 
    spec="1.0+" 
    codebase="http://myCompany.org/jnlpServer" 
    href="mail.jnlp"> <!-- URL to the site containing the jnlp application. It should match the value used on  export. Href, the name of this file -->
  <information>
    <!-- user readable name of the application -->
    <title> Mail Application </title>  
    <!-- vendor name -->
    <vendor>My company</vendor>
    <!-- vendor homepage --> 
    <homepage href="My company website" /> 
    <!-- product description -->
    <description>This is a mail client</description> 
    <icon kind="splash" href="splash.gif"/>
  </information>
 
  <!--request all permissions from the application. This does not change-->
  <security>
    <all-permissions/>
  </security>
 
  <!-- The name of the main class to execute. This does not change-->
  <application-desc main-class="org.eclipse.core.launcher.WebStartMain">
    <argument>-nosplash</argument>
  </application-desc>
 
  <resources>
    <!-- Reference to the startup.jar. This does not change -->
    <jar href="startup.jar"/>
 
    <!-- Reference to all the plugins and features consituting the application -->
    <!-- Here we are refering to the wrappering feature since it transitively refers to all the other plug-ins  necessary -->
   <extension
        name="Wrappering feature"
        href="features/Wrappering_1.0.0.jnlp"/>
 
    <!-- Information usually specified in the config.ini -->
	<property
        name="osgi.instance.area" 
        value="@user.home/Application Data/mail"/>
	<property
        name="osgi.configuration.area" 
        value="@user.home/Application Data/mail"/>
        
    <!-- The id of the product to run, like found in the overview page of the product editor -->
	<property
        name="eclipse.product" 
        value="mail.product"/>
  </resources>

  <!-- Indicate on a platform basis which JRE to use --> 
  <resources os="Mac">
    <j2se version="1.5+" java-vm-args="-XstartOnFirstThread"/>
  </resources>
  <resources os="Windows">
    <j2se version="1.4+"/>
  </resources>
  <resources os="Linux">
    <j2se version="1.4+"/>
  </resources>
</jnlp>

팁: 이 파일을 작성하고 나면, 이 파일을 startup.jar과 같은 폴더의 랩퍼링 기능에 저장할 수 있습니다. 이렇게 하면 내보낼 때마다 전체 구조를 가져올 수 있습니다.

플러그인 기반 응용프로그램

RCP 응용프로그램이 기능을 사용하지 않아도 Java Web Start로 수행할 수 있습니다.

이렇게 하려면 랩퍼링 기능을 작성하여 기본 jnlp 파일을 쉽게 작성하고 배치를 용이하게 하도록 할 것을 권장합니다. 이 랩퍼링 기능은 사용자 응용프로그램의 모든 플러그인을 나열합니다. 기능이 갱신되면 생성된 JNLP 파일을 복사하고 기본 JNLP 파일이 되도록 수정하십시오.

알려진 제한사항