如何分发基于Java的软件?

发布于 2024-10-14 19:17:56 字数 226 浏览 3 评论 0原文

现在,请不要误解我的意思,我是一个非常有能力的程序员,但是当我编程时,我通常使用 JavaScript、PHP、Python、SQL 等脚本语言来开发 Web 内容。如果我想开发 Java 软件(我对Java比较有经验),如何分发呢?

有没有什么好方法可以将 Java 软件打包成一个漂亮的小可执行文件,然后将其发送出去并运行它?或者,有没有什么好的方法可以将Java打包在某种安装程序中,然后将其发送出去进行安装和运行?

Now, don't get me wrong, I am a very competent programmer, but when I program, I typically develop things for the web using scripting languages like JavaScript, PHP, Python, SQL, etc. If I want to develop Java software (I am relatively experienced in Java), how do I distribute it?

Is there any good way to package up Java software in a nice little executable, send it out, and have it run? Alternatively, is there any good way to package up Java in some sort of installer, and send it out to be installed and run?

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

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

发布评论

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

评论(9

三寸金莲 2024-10-21 19:17:56

我正在使用 Launch4J http://launch4j.sourceforge.net/ 它将生成适用于 Windows 的 .exe 可执行文件,如果目标系统没有JVM,它会告诉用户下载并获取JVM。

I'm using Launch4J http://launch4j.sourceforge.net/ it will generate an .exe executable for Windows, if the targeted system don't have JVM, it will tell user to download and get JVM.

喜爱纠缠 2024-10-21 19:17:56

您可以使用 jar 工具或任何有能力的 Java IDE 将 Java 应用程序打包在所谓的 jar 文件中。这些 jar 文件是独立的,很少需要任何安装程序。

这些.jar 文件可以轻松分发和执行。

如果您习惯于 Web 开发,您可能也会对 Java Webstart 技术感兴趣。

一些帮助您入门的链接。

You can package Java applications in so called jar-files using the jar tool or any competent Java IDE. These jar-files are self-contained and seldom need any installer.

These .jar files can easily be distributed and executed.

If you're used to web-development, you may also be interested in the Java Webstart technology.

Some links to get you started.

深府石板幽径 2024-10-21 19:17:56

我发现两种方法可以很好地工作,具体取决于最终用户的需求。

1) Java WebStart - 允许集中分发和易于维护,但最适合在线用户。要求您有一个网站来查找文件 - 如今,这在 Google 应用程序引擎上很容易做到。

2) 使用 one-jar 将 Java 程序包装在单个 jar 中,然后使用 jsmooth 生成一个 .EXE 文件,以确保 Java 可用,提取 jar 文件并在其上调用 Java。这对于不总是上网的用户来说效果很好,您希望启动过程是透明的,但比 webstart 方法更不容易升级。

I have found two approaches to work well, depending on the needs of the end user.

1) Java WebStart - allows for central distribution and easy maintenance, but works best for online users. Require you to have a web site to locate the files - these days this is easy to do on the Google Application Engine.

2) Wrapping up the Java program in a single jar using one-jar, and then using jsmooth to generate an .EXE file which ensures Java is available, extracts the jar-file and invokes Java on it. This works well for users not always on the net, where you want the launch process to be transparent, but is less easy to upgrade than the webstart approach.

恏ㄋ傷疤忘ㄋ疼 2024-10-21 19:17:56

我使用 Maven 来处理我的项目的所有依赖项,这样当您使用 Maven 构建项目时,它们将编译成一个包含所有内容的漂亮可执行 jar,因此您无需担心将所有第三方 jar 放在正确的位置地点等

I use Maven to handle all the dependencies of my projects and that way when you utilise Maven to build your projects they will compile into one nice executable jar that contains everything so you dont need to worry about getting all your third-party jars in the right place etc.

紫竹語嫣☆ 2024-10-21 19:17:56

有几种方法:一种是创建一个安装程序,允许您的用户安装并运行它。为此,您可以查看 NSIS.... 或者您可以只使用 Java Web Start 您的用户只需单击链接即可启动您的应用程序。

There are a couple of ways: one is to create an installer that allows your user to install and run it. For this you can take a look at NSIS.... or you can just use Java Web Start where your user can just click the link and launch your application.

微暖i 2024-10-21 19:17:56

在这里您将找到一大组选项:Java 中的开源安装程序生成器< br>这对于应用程序的“天真的”客户或用户非常有用,可以使安装过程尽可能轻松。让他们通过一个安装程序安装所需的一切:DBMS、JVM、JMF 和其他选项。

Here you will find a large set of options: Open Source Installers Generators in Java
It is very useful for the "naive" customer or user of your application, to make the installation process as painless as possible. Let them install whatever is needed, DBMS, JVM, JMF and additional options via one installer.

锦欢 2024-10-21 19:17:56

您还可以考虑使用可用于 Java 的富客户端平台之一。学习曲线可能比仅仅创建一个 jar 文件并发布它要高得多,但在分发时您将免费获得很多东西。 (想想 Eclipse 通过更新站点进行自动更新)。

搜索“Eclipse RCP”和“Netbeans RCP”,您会在这里找到两个最大的竞争者。我还对“eclipse RCP installer”进行了搜索,其中一个搜索似乎很有趣:

http://download.instantiations.com/RCPPackagerDoc/integration/latest/docs/html/gettingstarted/GenInstaller.html

You can also consider use one of the rich client platforms available for Java. The learning curve is probably a lot higher than just creating a jar file and ship it, but you will get a lot for free when it comes to distribution. (Think Eclipse with auto update through an update site).

Do a search for "Eclipse RCP" and "Netbeans RCP" and you'll find the two biggest contenders here. I also performed a serach for "eclipse RCP installer" and one of the hits seems interesting:

http://download.instantiations.com/RCPPackagerDoc/integration/latest/docs/html/gettingstarted/GenInstaller.html

梦回旧景 2024-10-21 19:17:56

我个人喜欢 izpack。它生成一个 jar 文件安装程序,您可以将其包装在 launch4j 中,支持 Windows 特定快捷方式等内容,可以通过 XML 进行高度定制,并直接挂钩到 ant 中。

OneJar 非常适合较小的东西,但对于较大的程序或应用程序,它远没有那么灵活,而且根据我的经验,速度相当慢。

I personally like izpack. It generates a jar file installer that you could wrap up in launch4j, supports things like windows specific shortcuts, is highly customisable through XML and hooks directly into ant.

OneJar is great for smaller stuff, but for larger programs or applications it's nowhere near as flexible and in my experience is rather slow.

暖树树初阳… 2024-10-21 19:17:56

您好,您可以为您的应用程序制作一个安装程序。

在下面的链接中,您将找到有关 izpack 安装程序的很好的帮助。

http://www.imrantariq.com/blog/?p=89

链接如下包含使用 izpack 制作安装程序的详细 pdf 文件。

http://www.imrantariq.com/blog/?attachment_id=112

干杯

Hello you can make an installer for your application.

In the link below you will find a nice help about izpack installer.

http://www.imrantariq.com/blog/?p=89

Link below contains a detailed pdf to make installer with izpack.

http://www.imrantariq.com/blog/?attachment_id=112

cheers

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