在 Netbeans 中将 Jython 应用程序打包为 JAR

发布于 2024-08-19 22:22:20 字数 215 浏览 2 评论 0原文

我们目前正在考虑使用 Netbeans 开发 Jython 应用程序,我正在评估 Netbeans 的功能。

一旦安装了 Python 和 Jython 模块,在 Netbeans 中创建 Jython 应用程序似乎就很简单了。但我找不到一个功能可以让我们将 Jython 应用程序及其所有依赖项包装为 JAR 文件。这可以通过 Netbeans 或其他 IDE 实现吗?还是我需要手动进行这种打包?

We are currently considering using Netbeans to develop a Jython application and I am in the process of evaluating Netbeans' features.

It appears that creating a Jython application is trivial in Netbeans once the Python and Jython modules are installed. Yet I couldn't find a feature which would let we wrap my Jython app as a JAR file with all its dependencies. Is this possible with Netbeans or with some other IDE or do I need to do this kind of packaging by hand?

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

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

发布评论

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

评论(1

初见你 2024-08-26 22:22:20

您是否尝试过跳转

http://pypi.python.org/pypi/jump/0.9。 7.4

跳转首页

功能:

  • 将 Jython 应用程序分发到单个独立的 JAR 文件中。
  • 将 Jython 库分发到单个 JAR 文件中。 [v0.9.5 中的新增功能]
  • 分发本机 Mac OS X 应用程序包、Windows .exe 可执行文件、Python WSGI 应用程序的 WAR 文件。 [v0.9.5 中的新增功能]
  • 分发仅 Java 应用程序。 [v0.9.6 中的新增功能]
  • 为 ant 创建 build.xml 文件。 [v0.9.7新增]
  • 支持Java源代码和第三方JAR文件。
  • 支持用于分发 JAR 文件的 Java 本机接口文件。 [v0.9.5 中的新增功能]
  • 从 Jython 或 Java 代码启动创建的发行版。
  • 在最终发行版中包含指定的资源文件。 [v0.9.6 中的新增功能]
  • 仅将所需的 Python 包自动打包到最终发行版中,这意味着您不必担心使用 Python 第三方库,只要可以在 sys.path 中找到它们即可。
  • 显式导入指定的 Python 包。 [v0.9.5 中的新增功能]
  • 最终发行版中包含的所有 Python 模块都会编译为 $py.class 文件,这意味着您的源代码不是公开的。
  • 集成且易于使用的 Jython 工厂。 [v0.9.7 中的新增功能]

快速-start Guide


jython-wiki 中还有一个信息(不是跳转相关)

简而言之:

  1. Jar 文件:运行 jump jar --main-entry-point=file:main (其中 file 是 Python 脚本文件的名称,< code>main 是应用程序的 main 方法/入口点
  2. WAR 文件:运行 jump war --main-entry-point=file:main --war-wsgi-handler= ...

可以通过输出帮助/使用信息来显示可用于跳转的各种选项:运行jump --help

Have you tried jump

http://pypi.python.org/pypi/jump/0.9.7.4

jump Homepage

Features :

  • Distributing Jython applications into a single, independent JAR file.
  • Distributing Jython libraries into a single JAR file. [New in v0.9.5]
  • Distributing native Mac OS X application bundles, Windows .exe executables, WAR files for Python WSGI applications. [New in v0.9.5]
  • Distributing Java Only applications. [New in v0.9.6]
  • Creating build.xml file for ant. [New in v0.9.7]
  • Supporting Java source code and third-party JAR files.
  • Supporting Java Native Interface files for distributing JAR files. [New in v0.9.5]
  • Starting the created distribution from either Jython or Java code.
  • Including specified resource files in the final distribution. [New in v0.9.6]
  • Packaging only required Python packages into the final distribution automatically, which means you don't have to worry about using Python third-party libraries as long as they can be found in your sys.path.
  • Importing specified Python packages explicitly. [New in v0.9.5]
  • All Python modules included in the final distribution are compiled to $py.class files, which means your source code is not public.
  • Integrated easy use Jython factory. [New in v0.9.7]

Quick-start Guide


There is also a info in the jython-wiki (not jump related)

In brief:

  1. Jar file: run jump jar --main-entry-point=file:main (where file is the name of the Python script file and main is the application's main method/entry point
  2. WAR file: run jump war --main-entry-point=file:main --war-wsgi-handler=...

The various options available for jump can be shown by outputting help/usage information: run jump --help.

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