Eclipse에서 빌드된 응용프로그램은 Java Web Start를 사용하여 배치할 수 있습니다.
Java Web Start는 "웹 브라우저에서 한 번 클릭하는 것만으로 전기능의 응용프로그램을 실행할 수 있는 능력을 제공하는 응용프로그램 배치 기술"입니다.
Java Web Start를 통해 Eclipse를 시작하기 위한 전제조건은 다음과 같습니다.
root=<folderContainingStartup.jar>/
파일 > 내보내기 > 플러그인 개발 > 배치 가능한 기능을 수행하십시오.
마법사에서, 랩퍼 기능을 선택하고, "디렉토리" 옵션을 선택하여 JNLP 응용프로그램을 내보낸 후
"개별 JAR 아카이브로 기능 및 플러그인 패키징" 옵션을 선택하십시오. 마법사의 다음 페이지에서 "JAR 아카이브 서명" 섹션의
키 스토어에 대해 정보를 채우십시오. 그런 다음 "JNLP 섹션"에서, 응용프로그램에 서비스를 제공할
서버의 이름과 응용프로그램을 시작하는 데 필요한 JRE 레벨을 입력하십시오. 생성된 JNLP
파일에서 마지막 값이 사용되어 <j2se version="1.4+" /> 값을 채웁니다. 완료를 클릭하십시오.
site/ (jnlp 사이트의 루트)
startup.jar
features/
WrapperingFeature_1.0.0.jar
WrapperingFeature_1.0.0.jnlp
com.xyz.abc_1.0.0.jar
com.xyz.abc_1.0.0.jnlp
...
plugins/
org.eclipse.core.runtime_3.1.0.jar
com.foo.baz_1.0.0.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 constituting the application -->
<!-- Here we are referring to the wrapper feature since it transitively refers to all the other plug-ins necessary -->
<extension
name="Wrapper 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 파일이 되도록 수정하십시오.
Eclipse 응용프로그램을 Linux의 Web Start로 시작하는 경우 기본 윈도윙 시스템은 motif입니다. GTK를 실행하려면 기본 jnlp 파일에서 osgi.ws 특성을 "gtk"로 설정해야 합니다. 예를 들어, 다음을 추가할 수 있습니다.
<resources os="Linux"/>
<property name="osgi.ws" value="gtk"/>
</resources>