Macosx:如何在eclipse中制作可运行的jar文件?

发布于 2024-12-04 08:09:09 字数 610 浏览 6 评论 0 原文

我会尽力准确地告诉你我的问题,因为我已经被困了两天多了。 我正在尝试从现有源代码(一个名为 sweethome3d 的程序)在 Eclipse 中创建一个项目,然后对其进行修改。但是,问题甚至从修改代码之前就开始了。

我遵循以下步骤:

  1. 文件 - 导入 - 现有项目到工作区。
  2. 我选择源代码(http://sourceforge.net/projects/sweethome3d/files/SweetHome3D-source/SweetHome3D-3.3-src/SweetHome3D-3.3-src.zip/download
  3. 然后,我尝试导出 当我尝试执行它时,我
  4. 还必须在命令行中添加一些VM参数。
  5. 可运行的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:

  1. File - import - existings projects into workspace.
  2. I select the source code (http://sourceforge.net/projects/sweethome3d/files/SweetHome3D-source/SweetHome3D-3.3-src/SweetHome3D-3.3-src.zip/download)
  3. Then, I try to export it into Runnable jar file
  4. I have also to add some VM arguments in the command line when I try to execute it.
  5. 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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

懷念過去 2024-12-11 08:09:09

如果这个 与您正在运行的代码的版本相同,然后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 load com.eteks.sweethome3d.SweetHome3D dynamically. This class needs the class javax.jnlp.UnavailableServiceException, which is from javaws.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 from javaws.jar inside the JAR you're creating (like FatJar).

可是我不能没有你 2024-12-11 08:09:09

这可能是一些依赖性问题,在不了解更多信息的情况下很难判断。尝试使用 FatJar Eclipse 插件

It could be some dependency problem, hard to tell without knowing more. Try using FatJar Eclipse plugin

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文