简体   繁体   English

在 Windows 上为.jar 文件创建可执行的 OSX 文件

[英]Create executable OSX file on Windows for .jar file

I have created a java program (in Eclipse).我创建了一个 java 程序(在 Eclipse 中)。 I have successfully compiled it to a .jar file which I can run on windows without any problems.我已成功将其编译为.jar文件,我可以在 windows 上运行,没有任何问题。 I want to give this program to a friend who has a MacOSX.我想把这个程序送给一个有 MacOSX 的朋友。 So my aim is to:所以我的目标是:

  • Create a file which can be run on MacOSX创建一个可以在 MacOSX 上运行的文件

The twist is that I have to configure it on my Windows computer since I don't have access to a Mac.扭曲是我必须在我的 Windows 计算机上配置它,因为我无法使用 Mac。 Any advice would be of great help!任何建议都会有很大帮助!

I am not sure what you are referring as "create a file which can be run on macOSX"我不确定您所说的“创建一个可以在 macOSX 上运行的文件”

If you want to run on any OS you just need a JRE on that particular system without it you cant run.如果你想在任何操作系统上运行,你只需要在那个特定系统上安装一个 JRE,没有它你就无法运行。 It will provide a runtime environment to run a jar file.它将提供运行时环境来运行 jar 文件。 Then use below command to run the jar.然后使用以下命令运行 jar。

java -jar Myjar_file.jar

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM