как установить jdk на mac os

Как установить jdk на mac os

The following are the system requirements for installing the JDK on macOS:

Any Intel-based computer running macOS.

You cannot install Java for a single user. Installing the JDK on macOS is performed on a systemwide basis for all users. Administrator privileges are required to install the JDK on macOS.

Determining the Default JDK Version on macOS

When starting a Java application through the command line, the system uses the default JDK.

To run a different version of Java, either specify the full path, or use the java_home tool. For example:

Installing the JDK on macOS

Uninstalling the JDK on macOS

For example, to uninstall 15 Interim 0 Update 0 Patch 0:

Installation FAQ on macOS Platform

This topic provides answers for the following frequently asked questions about installing JDK on macOS computers.

1. How do I find out which version of Java is the system default?

When you run a Java application from the command line, it uses the default JDK. If you do not develop Java applications, then you do not need to worry about this. See Determining the Default JDK Version on macOS.

2. How do I uninstall Java?

If you want to continue to develop with Java 6 using command-line, then you can modify the startup script for your favorite command environment. For bash, use this:

4. What happened to the Java Preferences app in Application Utilities?

The Java Preferences app was part of the Apple Java installation and is not used by Oracle Java. Therefore, macOS releases from Apple that do not include Apple Java will not include Java Preferences.

Источник

Как установить jdk на mac os

The JDK supports both Intel-based (x64) and Apple Silicon (AArch64) Mac computers.

This topic includes the following sections:

System Requirements for Installing the JDK on macOS

JDK Installation Instruction Notation for macOS

Instructions for installing JDK contains a version notation that represents the Feature, Interim, and Update version information.

For example, if you are installing JDK 17 Interim 0, Update 0, and Patch 0, then the following string represents the name of the bundle:

macOS aarch64 (64-bit ARM) systems:

If a component has 0 as the suffix, it will be excluded.

Determining the Default JDK Version on macOS

When starting a Java application through the command line, the system uses the default JDK.

To run a different version of Java, either specify the full path, or use the java_home tool. For example:

Installing the JDK on macOS

Uninstalling the JDK on macOS

For example, to uninstall 17 Interim 0 Update 0 Patch 0:

Installation FAQ for macOS

This topic provides answers for the following frequently asked questions about installing JDK on macOS computers.

1. How do I find out which version of Java is the system default?

When you run a Java application from the command line, it uses the default JDK. If you do not develop Java applications, then you do not need to worry about this. See Determining the Default JDK Version on macOS.

2. How do I uninstall Java?

If you want to continue to develop with Java 6 using command-line, then you can modify the startup script for your favorite command environment. For bash, use this:

4. What happened to the Java Preferences app in Application Utilities?

The Java Preferences app was part of the Apple Java installation and is not used by Oracle Java. Therefore, macOS releases from Apple that do not include Apple Java will not include Java Preferences.

Источник

Как установить jdk на mac os

The following are the system requirements for installing the JDK on macOS:

Any Intel-based computer running macOS.

You cannot install Java for a single user. Installing the JDK on macOS is performed on a systemwide basis for all users. Administrator privileges are required to install the JDK on macOS.

Determining the Default JDK Version on macOS

When starting a Java application through the command line, the system uses the default JDK.

To run a different version of Java, either specify the full path, or use the java_home tool. For example:

Installing the JDK on macOS

Uninstalling the JDK on macOS

For example, to uninstall 16 Interim 0 Update 0 Patch 0:

Installation FAQ on macOS Platform

This topic provides answers for the following frequently asked questions about installing JDK on macOS computers.

1. How do I find out which version of Java is the system default?

When you run a Java application from the command line, it uses the default JDK. If you do not develop Java applications, then you do not need to worry about this. See Determining the Default JDK Version on macOS.

2. How do I uninstall Java?

If you want to continue to develop with Java 6 using command-line, then you can modify the startup script for your favorite command environment. For bash, use this:

4. What happened to the Java Preferences app in Application Utilities?

The Java Preferences app was part of the Apple Java installation and is not used by Oracle Java. Therefore, macOS releases from Apple that do not include Apple Java will not include Java Preferences.

Источник

Как установить Java JDK на Mac OS

В этой статье показано, как установить Java JDK на Mac OS, менеджер пакетов Homebrew, ручную установку и переключение между различными версиями JDK.

В этой статье показано, как установить Java JDK на Mac OS, менеджер пакетов Homebrew, ручную установку и переключение между различными версиями JDK.

P.S На момент написания статьи последней версией JDK GA является JDK15, а сборка раннего доступа – JDK16.

Примечание Начиная с macOS 10.15 Catalina, оболочка терминала по умолчанию переключается с втулки (Борн – снова снаряд) к зш (Оболочка Z). И мы должны переместить все сценарии запуска и переменные среды в

1. Доморощенный установить последнюю версию Java на Mac OS

1.3 информация о заваривании для отображения деталей формулы.

Формула java всегда содержит последнюю версию Java JDK (OpenJDK) Версия GA; на момент написания статьи последней версией GA является JDK15.

Формула java11 содержит версию Java 11 LTS.

1.4 заварите установку java для установки последней версии JDK 15.

2. Доморощенный установить Java 8 на Mac OS

2.4 Мы можем использовать формулу openjdk@8 для установки Java 8 на macOS.

2.5 openjdk@8 также является только для бочонка ; нам нужно создать символическую ссылку, чтобы оболочка macOS java могла ее найти.

2.7 Что делать, если у нас установлено несколько версий Java?

3. Доморощенный установите указанную Java (примите OpenJDK) в Mac OS.

3.2 Поиск по теме adoptopenjdk формула.

3.3 Мы выбираем adoptopenjdk14 формулу для установки JDK 14.

3.4 Формула adopt openjdk создает домашний каталог JDK непосредственно в /Библиотеке/Java/Javavirtualmachines/|/.

4. Ручная установка Java (сборки раннего доступа) на macOS.

По некоторым причинам нам необходимо установить Java на macOS вручную:

P.S На момент написания статьи сборка JDK для раннего доступа – это JDK 16.

4.2 Извлекает загруженный tar.gz файл в /Библиотеку/Java/Javavirtualmachines

5. Переключение между различными версиями JDK

Из приведенного выше примера с 1 по пример 4 мы установили ваши версии JDK на macOS.

5.1 Перечислите все версии JDK на macOS.

5.2 Добавьте нижеприведенную функцию в

/.zshrc (для mac OS 10.15 Catalina и выше) или

/.bashrc (до mac OS 10.15 Catalina).

/.zshrc если его не существует.

/.zshrc для отражения изменений.

5.4 Переключение между различными версиями JDK.

Источник

8 Installation of the JDK and the JRE on macOS

This topic includes the following sections:

System Requirements for Installing the JDK and JRE on macOS

The following are the system requirements for installing the JDK and the JRE on macOS:

Any Intel-based computer running macOS.

You cannot install Java for a single user. Installing the JDK and JRE on macOS is performed on a systemwide basis for all users. Administrator privileges are required to install the JDK and JRE on macOS.

When you install the JDK, it also installs the JRE. However, the system will not replace the current JRE with a lower version.

To determine the current JRE version installed on your system, see Determining the JRE Version Installed on macOS. To install an earlier version of the JRE, you must first uninstall the current version. See Uninstalling the JRE on macOS.

When you install the JRE, you can install only one JRE on your system at a time. The system will not install a JRE that has an earlier version than the current version.

To determine the current JRE version installed on your system, see Determining the JRE Version Installed on macOS. To install an earlier version of the JRE, you must first uninstall the current version. See Uninstalling the JRE on macOS.

Determining the JRE Version Installed on macOS

Only one JRE can be installed on the system at any time. Installing a JRE removes the previously installed JRE.

The JRE version installed on the system can be determined in one of two ways:

Enter the following in a Terminal window (note the escaped space character, ignore line break):

If you have not yet installed Apple’s Java OS X 2012-006 update, then you are still using a version of Apple Java 6 that includes the plug-in and the Java Preferences application. See Notes for Users of macOS That Include the Apple Java 6 Plug-in.

The system will not install a JRE that has an earlier version than the current version. If you want to install an earlier version, then you must first uninstall the existing version.

Determining the Default JDK Version on macOS

When starting a Java application through the command line, the system uses the default JDK. It is possible for the version of the JRE to be different from the default version of the JDK.

If you have not yet installed Apple’s Java OS X 2012-006 update, then you are still using a version of Apple Java 6 that includes the plug-in and the Java Preferences application. See Notes for Users of macOS That Include the Apple Java 6 Plug-in.

To run a different version of Java, either specify the full path, or use the java_home tool: For example:

Installing the JDK on macOS

When you install the JDK, the associated JRE is installed at the same time. The JavaFX SDK and Runtime are also installed and integrated into the standard JDK directory structure.

Before the file can be downloaded, you must accept the license agreement.

Installing the JRE on macOS

Before the file can be downloaded, you must accept the license agreement.

Uninstalling the JDK on macOS

For example, to uninstall 10 Interim 0 Update 2 Patch 1:

Uninstalling the JRE on macOS

Installation FAQ on macOS Platform

This topic provides answers for the following frequently asked questions about installing JDK and JRE on macOS computers.

1. Should I install the JRE or the JDK?

If you only plan to run Java applications, then install the Java Runtime Environment (JRE). The JRE is also referred to as Oracle Java. After you have installed the JRE, you can start Java applets and applications by double-clicking JAR files, JNLP files, and by using the browser. Note that 32-bit browsers, such as Firefox in 32-bit mode, and Chrome, are not supported by the JRE.

If you also plan to create Java applications, then install the Java Development Kit (JDK).

2. How do I find out which version of Java is the system default?

When you start a Java application by clicking a JNLP file, or through the browser, it uses the installed JRE. Only one JRE can be installed. See Determining the JRE Version Installed on macOS.

When you run a Java application from the command line, it uses the default JDK. If you do not develop Java applications, then you do not need to worry about this. See Determining the Default JDK Version on macOS.

If you have not yet installed Apple’s Java macOS 2012-006 update, then you are still using a version of Apple Java 6 that includes the plug-in and the Java Preferences application. See Notes for Users of macOS That Include the Apple Java 6 Plug-in.

3. How do I clear the Java cache?

Follow these steps:

From the Delete Files and Applications dialog box, select Cached Applications and Applets and click OK to clear those files from the cache.

To clear the applet and Web Start cache from a window, use the following command (note escaped space character):

4. How are Java updates managed on macOS?

Every time you start a Java applet or a Java Web Start (JWS) application, the system starts your program and determines in the background (so that performance of your Java application is not affected) if it has checked for a Java update in the last 7 days.

If an update is available, then the Software Update window appears.

The latest update gets downloaded and installed. Restart the browser and other applications to work on the new Java update.

5. How do I uninstall Java?

Depending on your installation, see the related link:

6. I have installed Java for macOS 2012-006 and Apple Java 6 can no longer be used for applets or Web Start. How do I get it back?

The Java for macOS 2012-006 update from Apple uninstalls the Apple-provided Java applet plug-in from all web browsers. You can download the latest version of Java from Java SE Downloads, which has improved security, reliability, and compatibility.

If you prefer to continue using Apple’s Java 6 plug-in, follow the steps provided in the Java for OS X 2014-001 topic at the Apple Developer site.

If you want to continue to develop with Java 6 using command-line, then you can modify the startup script for your favorite command environment. For bash, use this:

8. Can I restore Apple Java after uninstalling Oracle Java?

Go back to Apple Java using the following instructions:

Uninstall Oracle Java by deleting the plug-in file. From a command-line, enter:

Create a symlink using the following command, entered on a single line:

9. I am running Mountain Lion (macOS 10.8) or later and Gatekeeper is blocking an app from launching. What is going on?

10. What happened to the Java Preferences app in Application Utilities?

The Java Preferences app was part of the Apple Java installation and is not used by Oracle Java. Therefore, macOS releases from Apple that do not include Apple Java will not include Java Preferences.

One of the functions of Java Preferences was to set the current version of the JRE. Under Oracle Java, only a single version of the JRE can be installed at a time. See Installing the JRE on macOS.

11. I have Oracle’s version of the JRE installed, but it is not listed in Java Preferences.

This is correct. The JRE will not show up in the Java Preferences list unless you install the full JDK.

12. I have Oracle’s version of the JRE installed, but when I try to run the java command from the command line, it does not work.

Notes for Users of macOS That Include the Apple Java 6 Plug-in

If you have not yet installed Apple’s Java macOS 2012-006 update, then you are still using a version of Apple Java 6 that includes the plug-in and the Java Preferences application.

Under Apple’s implementation of Java, it was possible to have multiple JREs installed. The Java Preferences application was used to determine the first compatible version that would be used. You can change the default JRE by starting Java Preferences and then dragging Java SE 10 to the top of the list.

The Java Preferences window contains a list of installed JREs. Java applications and command-line tools use the listed order to determine the first compatible version to use. The Vendor column indicates whether the Java release is supplied by Apple or Oracle. The Version column specifies the version of Java that is installed.

Reordering the list, by dragging Java SE 10 to the top, makes it the default version of Java.

Источник

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *