我会尽力准确地告诉你我的问题,因为我已经被困了两天多了。
我正在尝试从现有源代码(一个名为 sweethome3d 的程序)在 Eclipse 中创建一个项目,然后对其进行修改。但是,问题甚至从修改代码之前就开始了。
我遵循以下步骤:
- 文件 - 导入 - 现有项目到工作区。
- 我选择源代码(http://sourceforge.net/projects/sweethome3d/files/SweetHome3D-source/SweetHome3D-3.3-src/SweetHome3D-3.3-src.zip/download)
- 然后,我尝试导出 当我尝试执行它时,我
- 还必须在命令行中添加一些VM参数。
- 可运行的jar文件不运行
你知道我做错了什么吗?
提前致谢。
I will try to tell you exactly my problem, because I am stuck for more than 2 days now.
I am trying to make a project in Eclipse from existing source code (a program called sweethome3d) and then modify it. But, the problem even starts from even before modifying the code.
There are the steps that I am following:
- File - import - existings projects into workspace.
- I select the source code (http://sourceforge.net/projects/sweethome3d/files/SweetHome3D-source/SweetHome3D-3.3-src/SweetHome3D-3.3-src.zip/download)
- Then, I try to export it into Runnable jar file
- I have also to add some VM arguments in the command line when I try to execute it.
- The runnable jar file does not run
- in command line
- with double click
Do you have any idea what I am doing wrong?
Thanks in advance.
发布评论
评论(2)
如果这个 与您正在运行的代码的版本相同,然后
SweetHome3DBootstrap.java
,在第 90 行,正在尝试动态加载com.eteks.sweethome3d.SweetHome3D
。该类需要类javax.jnlp.UnavailableServiceException
,它来自javaws.jar
。因此,当您尝试运行 JAR 时,它在运行时缺少
javaws.jar
。您需要将其添加到类路径(在运行时通过命令行指定,或通过 JAR 文件的“Class-Path:”清单标头指定),或者重新打包 javaws.jar< 中的类/code> 您正在创建的 JAR(如 FatJar)内。If this is the same as the version of the code you're running, then
SweetHome3DBootstrap.java
, at line 90, is attempting to loadcom.eteks.sweethome3d.SweetHome3D
dynamically. This class needs the classjavax.jnlp.UnavailableServiceException
, which is fromjavaws.jar
.So, when you try to run your JAR, it's missing
javaws.jar
at runtime. You'll need to either add it to the classpath (specified via the command-line when running, or via the JAR file's 'Class-Path:' manifest header), or re-package the classes fromjavaws.jar
inside the JAR you're creating (like FatJar).这可能是一些依赖性问题,在不了解更多信息的情况下很难判断。尝试使用 FatJar Eclipse 插件
It could be some dependency problem, hard to tell without knowing more. Try using FatJar Eclipse plugin