如何在java中创建跨平台应用程序 [英] How to create a cross platform app in java

查看:176
本文介绍了如何在java中创建跨平台应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个与项目管理和一些图像处理相关的桌面应用程序,问题是我想在所有主要平台上运行它 Windows,Mac& Linux

我不想创建3种不同的设置,我只想创建一个设置。我正在使用Windows进行开发。

i认为java可能会有所帮助,而且我想在sql,本地或网络上通过这个应用程序保存一些数据。

谢谢。

解决方案

根据定义,Java是多平台的,除非您使用JNI将您的应用程序与特定于平台的内容相关联。



但是,操作系统有特定的安装标准,安装包格式(如MSI,Apple .PKG等),绑定到特定于平台的API等等。根据定义,它们不是多平台的,所以你无能为力。



问题是:如果这只是一个应用程序,为什么你需要这个平台安装者呢?只有你需要修改注册表,环境,将文件添加到不同的目录才有意义。正式安装的主要原因是自动清理卸载。如果这只是一个Java应用程序,我会认为它没有做那样的事情。您可以在用户决定删除可以用Java编写的应用程序时复制文件并删除它们。



-SA

hi, i want to create a desktop app which is related to project management and some image processing , the problem is i want to run it on all Major platform Windows , Mac & Linux
I don't want to create 3 different setup , i just want to create a single setup. i am using windows for development.
i think java may be helpful and also i want to save some data by this app in sql, locally or on the web.
Thank you.

解决方案

Java is multi-platform by definition, unless you link your application with something platform-specific, using JNI.

However, the OS have they specific installation standards, formats of installation packages (like MSI, Apple .PKG, etc.), binding to platform-specific API, and so on. They are not multi-platform by definition, so there is nothing you can do about it.

The question is: if this is just an application, why would you need this platform installer at all? They make sense only of you need to modify registry, environment, add files to different directories. The major reason for having formal installation is to have automatic clean uninstallation. If this is just a Java application, I would assume it does not do anything like that. You can just copy files and remove them when the user decides to remove the application, which you can write in Java.

—SA


这篇关于如何在java中创建跨平台应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆