如何分发我的 Java 应用程序以方便用户使用?

发布于 2024-10-05 20:49:22 字数 873 浏览 0 评论 0原文

我真的很困惑 - 但实际上这很奇怪,因为我知道两种编程语言,但我无法弄清楚这样简单的事情...... 我已经寻找了很长时间,但我似乎无法理解它。 你看,我已经用 AutoIt 编写了很长一段时间,并且我用它编写了两个程序,即将上市!不过,它们本来就不会长期存在(有点像 Windows Vista),所以最近我学习 Java 并取得了成功。我在学习 Java 教程时在 eclipse 中编写了一些非常非常简单的应用程序!我现在准备将我的程序转移到Java上,因为Java的跨平台能力为我赢得了更广阔的市场,但我没想到发行会如此复杂。 我遇到的第一个问题是在多个操作系统上的易用性:我不希望我的客户必须处理 JRE 或多个文件,我需要一个可以在 MAC、Windows、Linux 等上运行的双击解决方案,所以即使是完全的计算机新手也可以启动我的软件!其次,这并不是什么问题,而是我不知道该怎么做。这包括我的软件包中的文件,有些文件需要与程序分开,但其他文件可以编译,但实际上我认为这可以通过安装程序来解决 - 这可能会更容易!最后,我制作的另一个程序是独立的,因此它可以在 USB 记忆棒上运行(这是它的设计目的),现在,你认为我如何做到这一点,以便在插入时它可以在多个操作系统上启动,而无需任何操作麻烦吗?

更新 :: 忘记添加 :: 我对安全性的担忧

我已阅读并从个人经验中知道:反编译 .jar 是多么容易,如果没有正确保护,请阅读源代码!我知道混淆,我知道我会有法律支持,但这只是让我担心。即使从用户可能会对我的软件产生错误的第一印象的角度来看。

一句话总结(请继续阅读上面): 我需要能够让人们通过双击例如来使用我用Java编写的软件,就像用AutoIt制作的东西一样 - 一个标准应用程序,即*.exe

提前致谢

I'm really confused - but really it's pretty wierd because I know two programming langauges but I can't figure out something simple like this...
I've been looking for ages but I can't seem to get my head around it.
You See, for a long time I've been writting in AutoIt, and I've written two programs in it that are due to go on sale soon! They were never meant to be out for a long time though (kind of like Windows Vista), so lately I've been learning Java with success. I've wrote a few very very simple applications in eclipse while going through Java tutorials! I'm now ready to transfer my programs to Java, to gain me a wider market due to Java's cross-platform ability, but I never anticipated distribution to be this complex.
My first problem I have come across is ease of use on multiple OS's: I don't want my customers to have to deal with JRE or multiple files, I need a double click solution that will work on MAC, Windows, Linux, etc so that even complete computer newbie's can launch my software! Secondly, this is not as much a problem as something I am not sure how to do. This is including files in my software package some need to stay seperate from the program but others could be compiled, but actually I suppose this can be worked around by an installer - which would probably be easier! And finally the other proram I made is stand - alone so it can work on USB sticks (which what it was designed for), now, how do you suppose I do this so it will launch on multiple opearating systems when it's plugged in without any hasle?

Update :: Forgot to add :: My concerns about security

I have read and from personal experience I know: how easy it is to decompile a .jar, and if there not protected properly read the source code! I know about obfuscation and I know I'll have legal back up but it just worries me. Even from the point of view that user may get the wrong first impretion of my software.

So to conclude in one sentace (Please read above still):
I need to be able to let people use my software written in Java by double clicking e.g. Like something made in AutoIt - a standard application i.e *.exe

Thanks in advance

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

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

发布评论

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

评论(2

不羁少年 2024-10-12 20:49:22

您可以采用两种方法,无需涉及任何额外的软件。

第一种方法是创建一个可执行 jar(Java 存档)文件。在大多数系统上,Java 自动将 .jar 扩展名与 Java 解释器关联起来。 JAR 的 清单文件 会告诉它 双击时启动哪个类

第二个不太推荐的途径是创建一个 Java Web Start 应用程序,带有 JNLP 启动器文件。它更多地针对从网站分发的应用程序。

There are two routes you can take without needing any extra software involved.

The first is to just make an executable jar (Java Archive) file. Java automatically associates the .jar extension with the Java interpreter on most systems. The JAR's manifest file will tell it which class to launch when you double-click it.

The second, less recommended route, is to make a Java Web Start application, with a JNLP launcher file. The is aimed more at applications distributed from web sites.

内心激荡 2024-10-12 20:49:22

我建议第三种方法:为您的应用程序编写几个特定于平台的启动脚本。例如,对于 Windows 为 run.bat,对于 Linux 为 run.sh。在每个脚本中编写一个命令来运行带有所有必要参数的 JRE。您还可以在此脚本中维护一些启动前检查(是否安装了 JRE?)或一些特定于平台的操作。

I'll suggest the third way: write several platform-specific launch scripts for your application. For example, run.bat for Windows and run.sh for Linux. Inside every script write a command to run JRE with all the necessary parameters. You can also maintain some pre-launch checks (is JRE installed?) or some platform-specific actions in this scripts.

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