如何将 Java 7 EE SDK 下载为 Mac OSX 的 .sh 文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18794055/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-12 11:07:35  来源:igfitidea点击:

How to install Java 7 EE SDK download as .sh file for Mac OSX

javamacosjava-ee-7

提问by webworm

I am new to developing Java on Mac OSX. I wanted to download the Java 7 EE SDK so I could both desktop/mobile/enterprise development with Java. The download file is .sh(specifically java_ee_sdk-7-jdk7-macosx-x64) which I am not familiar with. The Java 7 SE SDK is a .dmgfile which is the format I expected for the Enterprise Edition instead of the .shfile.

我是在 Mac OSX 上开发 Java 的新手。我想下载 Java 7 EE SDK,这样我就可以使用 Java 进行桌面/移动/企业开发。下载文件是.sh(特别是java_ee_sdk-7-jdk7-macosx-x64)我不熟悉的。Java 7 SE SDK 是一个.dmg文件,它是我期望的企业版格式而不是.sh文件。

  1. Why are the SE and EE editions different file formats? (.shvs .dmg)
  2. How do I install the Enterprise Edition being that it is a .shfile?
  1. 为什么 SE 和 EE 版本的文件格式不同?(.sh对比.dmg
  2. 如何安装企业版,因为它是一个.sh文件?

*Note: Currently the only JRE I have installed on the Mac is the Apple version which I understand has been deprecated.

*注意:目前我在 Mac 上安装的唯一 JRE 是 Apple 版本,据我所知已被弃用。

采纳答案by Dev

Run it at the command line.

在命令行运行它。

From the install manual: Java Platform, Enterprise Edition 7 SDK - Installation Instructions

来自安装手册:Java Platform, Enterprise Edition 7 SDK - Installation Instructions

Solaris, Linux, and Mac OS X systems:

  • If necessary, grant execute permissions to the distribution file: chmod +x ./ distribution-filename

  • At the command prompt, type: sh ./ distribution-filename

Solaris、Linux 和 Mac OS X 系统

  • 如有必要,授予分发文件的执行权限:chmod +x ./ distribution-filename

  • 在命令提示符下,键入:sh ./ distribution-filename

For future reference a *.sh file is a shell script. You can inspect the shebang(#!) at the first line of the file to see what shell should be used to interpret the script. In the case of the JavaEE 7 installer the shebang is #!/bin/shwhich indicates a Bourne compatible shellshould be used.

为了将来参考,*.sh 文件是一个shell 脚本。您可以检查文件第一行的shebang( #!) 以查看应该使用什么 shell 来解释脚本。对于 JavaEE 7 安装程序,shebang is#!/bin/sh表示应该使用Bourne 兼容的 shell

回答by Fritz

Found a solution in this link:

在此链接中找到了解决方案:

https://apple.stackexchange.com/questions/63381/installing-glassfish-on-mountain-lion

https://apple.stackexchange.com/questions/63381/installing-glassfish-on-mountain-lion

Tried the command export DISPLAY=:0and it skipped the "This Program requires..." message.

尝试了该命令export DISPLAY=:0,它跳过了“此程序需要...”消息。

Hope this helps

希望这可以帮助

回答by user3388785

glassfish-3.1.2.2-unix.shrequires DISPLAYenvironment variable to be set. Please re-run after assigning an appropriate value to DISPLAY.

glassfish-3.1.2.2-unix.sh需要DISPLAY设置环境变量。请在为 分配适当的值后重新运行DISPLAY

export DISPLAY=:0
chmod +x java_ee_sdk-7-jdk7-macosx-x64-ml.sh
./java_ee_sdk-7-jdk7-macosx-x64-ml.sh

export DISPLAY=:0
chmod +x java_ee_sdk-7-jdk7-macosx-x64-ml.sh
./java_ee_sdk-7-jdk7-macosx-x64-ml.sh