4

我做了很多研究,但我似乎无法弄清楚如何使用 Eclipse 制作 JNLP 文件。我知道一些 XML,我想做的是从桌面启动一个(Java)Swing 程序作为桌面应用程序和在线。有人可以帮帮我吗?

4

1 回答 1

0

If I got you right you want to launch Swing applet application from Eclipse.

You can either create launch file, something like this:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.launching.javaApplet">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/some.zip"/>
</listAttribute>
<mapAttribute key="org.eclipse.debug.core.preferred_launchers">
<mapEntry key="[debug]" value="org.eclipse.jdt.launching.javaApplet"/>
<mapEntry key="[run]" value="org.eclipse.jdt.launching.javaApplet"/>
</mapAttribute>
<intAttribute key="org.eclipse.jdt.launching.APPLET_HEIGHT" value="905"/>
<stringAttribute key="org.eclipse.jdt.launching.APPLET_NAME" value=""/>
<mapAttribute key="org.eclipse.jdt.launching.APPLET_PARAMETERS">
<mapEntry key="someEntry" value="5131"/>
</mapAttribute>
<intAttribute key="org.eclipse.jdt.launching.APPLET_WIDTH" value="1265"/>
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jre"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.some.YourApplet"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms256m -Xmx512m"/>
</launchConfiguration>

This option is good for testing swing application locally.

Or, if you still want to use jnlp, it is also possible to have jnlp with proper codebase, the same that you have in your jar.

If you have errors while launching jnlp locally, please post it.

于 2014-07-30T11:43:32.670 回答