Java runtime mac os catalina

Using Java SE on macOS Catalina

With macOS 10.15, Apple introduced new application security checks, which are used by Gatekeeper to verify the contents of distributed software. When you install or run software for the first time, Gatekeeper verifies that the software has been notarized. See Notarizing Your App Before Distribution.

JDK 14 is the first release that complies with the new macOS 10.15 hardening and notarization requirements. If you want to install and test earlier versions of the JDK or JRE on macOS 10.15, this document explains some expect warnings and how to proceed.

As of the time when this article was written you can still install and run non-notarized software on macOS 10.15 systems by modifying your security preferences. The following steps show you how to install a non-notarized JDK or JRE.

Note: These steps use the JDK 8u231 macOS installer as an example. These steps apply equally to all other JDK and JRE releases.

Installing the JDK Using a .dmg File

  1. Double-click on the .dmg file to begin the installation. The system verifies the .dmg file, then opens a Finder window with the icon of an open box (package) and the name of the .pkg file.
  2. Double-click the package icon to start the installation app. A window appears with a status bar with text similar to the following:

Verifying «JDK 8 Update 231.pkg».

Then, a window appears with text similar to the following:

«JDK 8 Update 231.pkg» can’t be opened because Apple cannot check it for malicious software.

This software needs to be updated. Contact the developer for more information.

Click OK.

Open System Preferences, click Security & Privacy, then click the General tab. In the section Allow apps downloaded from:, the following text appears:

«JDK 8 Update 231.pkg» was blocked from use because it is not from an identified developer.

Click the Open Anyway button.

A window appears with text similar to the following:

«JDK 8 Update 231.pkg» can’t be opened because Apple cannot check it for malicious software.

This software needs to be updated. Contact the developer for more information.

Click the Open button.

  • A window appears with the following text:
  • Installer is trying to install new software. Enter your password to allow this.

    Enter your user name and password, then click the Install Software button.

    Installing the JDK from a File Archive

    You don’t have to modify your security preferences if you install the JDK from a .tar.gz file archive, in particular, a prebuilt OpenJDK package. However, the system may warn you the first time you run a Java command-line tool.

    Running a Java Command-Line Tool for the First Time

    When you run a command-line tool for the first time (such as java ), depending on which app (such as Safari or Firefox) you used to download the installer, a window may appear with text similar to the following:

    «jdk1.8.0_231.jdk» is an app created by Safari. Are you sure you want to open it?

    Click the Open button.

    Depending on the folder in which you installed the JDK or JRE, another window may also appear with text similar to the following:

    «java» would like to access files in your Downloads folder.

    Источник

    Installing Java on macOS 10.15 Catalina

    Since OS X 10.7 Java is not (pre-)installed anymore, let’s fix that. As I’m writing this, Java 11.0.4 is the latest version and AdoptOpenJDK is one of the best places to find Prebuilt OpenJDK Binaries. Easy to follow details about how to install OpenJDK are available here.

    However, the easiest way is to select OpenJDK 11 (LTS), the HotSpot JVM, and macOS x64, which will expose two option like these:

    Clicking on “Install JDK installer”, will download the OpenJDK installer package, e.g. OpenJDK11U-jdk_x64_mac_hotspot_11.0.4_11.pkg, which when executed, will install into this location: /Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk

    Almost done. After opening a terminal, the successful installation of the JDK can be confirmed like so:

    … hopefully showing something like this:

    JAVA_HOME is an important environment variable and it’s important to get it right. Here is a trick that allows me to keep the environment variable current, even after a Java Update was installed. In

    /.zshrc, I set the variable like so:

    In previous macOS versions, this was done in

    /.bash_profile. Now it’s done.

    Source Code

    The source code of the Java Platform, Standard Edition 11 Reference Implementations binaries is available under the GPLv2 in a single zip file.

    Источник

    Java 6 runtime «legacy version» for MacOS Catalina

    mikzn

    macrumors 68030

    I have a few apps that require the apple legacy version of Java runtime

    I tried to install the most recent link I could find for the «legacy Java 6 runtime for macOS 10.13 High Sierra»

    Читайте также:  Как обновить windows installer windows 10

    This link / download worked for Mojave but won’t install for Catalina

    Has anybody found a new link or workaround for this?

    Edit 22 Nov 2019 — this thread is getting long and I thought it might help new members or others searching for this solution to go directly to the pertinent part of the the thread — post # 12 by bogdanw — at this link

    Edit 28 March 2021 update — here is another part of the thread updated by bogdanw — see post 115

    sfwalter

    macrumors 68020

    This may be tough as Java 6 on the Mac was only provided by Apple. Oracle/Open JDK didn’t take over to providing binaries until Java 7.

    Do you specifically need Java 6 or can you run it with a later version of Java?

    bogdanw

    macrumors 65816

    mikzn

    macrumors 68030

    Cool and thanks

    do you think I should try and point the app to the newer version of Java ? I tried it on El Cap and wasted a lot of time with no success.

    here is info on the most important app — For Me

    iBackup download links
    Download the appropriate version of the iBackup installer for your operating system of choice from the links below:

    The above links will download a zip file containing the installer and installation instructions. You may need to authorize software installation from unknown third parties in order to proceed, depending on the version of your operating system. Please refer to the corresponding widget in the Control Panel of your Windows PC or System Preferences of your Mac.

    iBackup requires Java to operate, the 32-bit version is recommended to avoid issues with most recent multithreaded versions of the Java Runtime Environment. Make sure Java is installed and fully working.

    Источник

    How to install Java JDK on macOS

    By mkyong | Last updated: January 19, 2021

    Viewed: 220,923 (+5,913 pv/w)

    This article shows how to install Java JDK on macOS, Homebrew package manager, manual installation, and switch between different JDK versions.

    • macOS 11 Big Sur
    • Homebrew 2.7.4
    • JDK 8, 14, 16, 16 (AdoptOpenJDK and OpenJDK)

    P.S At the time of writing, the latest JDK GA is JDK 15, and the early access build is JDK 16.

    Note
    Since macOS 10.15 Catalina, the default Terminal shell switch from the bash (Bourne-again shell) to zsh (Z shell). And we should move all the startup scripts and environment variables in

    1. Homebrew install latest Java on macOS

    1.1 Install and upgrade Homebrew.

    1.2 brew search java to find all available Java-related formula.

    1.3 brew info to show the formula details.

    The java formula is always containing the latest Java JDK (OpenJDK) GA version; at the time of writing, the latest GA is JDK 15.

    The java11 formula is containing the Java 11 LTS version.

    1.4 brew install java to install the latest JDK 15.

    1.5 Where does Homebrew install the java?
    Homebrew installed the JDK files and directories at /usr/local/Cellar/openjdk/ , and symbolic link at /usr/local/opt/openjdk points to the latest Java 15.0.1 version.

    1.6 The java formula is keg-only, which means it is installed in /usr/local/Cellar but not linked into places like /usr/local/bin or /Library/Java/JavaVirtualMachines/ (macOS /usr/bin/java wrapper).

    For macOS /usr/bin/java wrapper to find the installed JDK, we manually create a symbolic link at /Library/Java/JavaVirtualMachines/ .

    Источник

    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.

    Installing a JRE from Oracle will not update java -version symlinks or add java to your path. To do this, you must install the JDK.

    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:

    From System Preferences , and then the Other section, click the Java icon. This starts the Java Control Panel . You then click About to display the version information.

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

    % /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java -version

    Читайте также:  Тема япония для windows

    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.

    You can determine which version of the JDK is the default by entering java -version in a Terminal window. If the installed version is 9 Minor 1, Security 1, Patch 1, then you see a string that includes the text 9.1.1.1 . For example:

    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:

    % /usr/libexec/java_home -v 9.1.1.1 —exec javac -version

    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.

    1. Download the JDK .dmg file, jdk-9. minor.secruity.patch -macosx-x64.dmg .

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

    Installing the JRE on macOS

    1. Download the JRE .dmg file, jre-9. minor.security.patch _osx-x64_bin.dmg .

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

    Uninstalling the JDK on macOS

    Do not attempt to uninstall Java by removing the Java tools from /usr/bin . This directory is part of the system software and any changes will be reset by Apple the next time that you perform an update of the OS.

    1. Go to /Library/Java/JavaVirtualMachines .
    2. Remove the directory whose name matches the following format by executing the rm command as a root user or by using the sudo tool:

    For example, to uninstall 9 Minor 1 Security 2 Patch 1:

    % rm -rf jdk-9.1.2.1.jdk

    Uninstalling the JRE on macOS

    Do not uninstall Java by removing the Java tools from /usr/bin . This directory is part of the system software and any changes will be reset by Apple the next time that you perform an update of the OS.

    1. Go to /Library/Internet Plug-Ins .
    2. Remove the JavaAppletPlugin.plugin directory by executing the rm command as a root user or by using the sudo tool.
    3. Go to /Library/PreferencePanes .
    4. Remove JavaControlPanel.prefpane by executing the rm command as a root user or by using the sudo tool.

    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 System Preferences , start the Java Control Panel from Other section by clicking the Java icon.

    From the Java Control Panel , on the General tab, go to Temporary Internet Files section and click Settings .

    In the Temporary Files Settings window, click Delete File .

    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.

    Select Next , and enter your user Name and Password .

    Читайте также:  Пропал драйвер realtek high definition audio windows 10

    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.

    7. After installing Java for macOS 2012-006, can I continue to use Apple’s Java 6 alongside the macOS JDK or JRE for Java 9?

    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:

    $ export JAVA_HOME=`/usr/libexec/java_home -v 1.6`

    Some applications use /usr/bin/java to call Java. After installing Java for macOS 2012-006, /usr/bin/java will find the newest JDK installed, and will use that for all of the Java-related command-line tools in /usr/bin . You may need to modify those applications to find Java 6, or contact the developer for a newer version of the application.

    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:

    % sudo rm -rf “/Library/Internet Plug-Ins/JavaAppletPlugin.plugin”

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

    % sudo ln -s /System/Library/Java/Support/CoreDeploy.bundle/Contents/JavaAppletPlugin.plugin ”/Library/Internet Plug-Ins/JavaAppletPlugin.plugin”

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

    Gatekeeper, introduced in Mountain Lion (macOS 10.8), is designed to prevent potentially malicious application packages (apps) from starting. When you attempt to start an app that does not meet certain criteria, Gatekeeper will block it. To override this, you can modify the Gatekeeper’s default settings to App Store and identified developers from Settings , General , and Allow apps downloads from section .

    To create a Java application that will start without interruption under the default Gatekeeper settings, the app must be bundled with a JRE, use Oracle’s launcher stub, and be signed with an Apple Developer ID. For details on creating an app that satisfies these requirements, see Self-Contained Application Packaging for OS X in the Java Platform, Standard Edition Deployment Guide .

    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.

    To access the Java Control Panel, in the System Preferences panel, click the Java icon. If you don’t see the Java icon in the System Preferences , in the Other section, then you do not have an Oracle JRE installed.

    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.

    Installing a JRE from Oracle does not update java -version symlinks or add the java command to your path. For this functionality, you must install the full JDK.

    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.

    There is an important difference about the installation of Oracle Java (both JRE and JDK) that you should be aware of. The Java Preferences application, started by selecting Applications and then Utilities , is part of Apple’s implementation of Java. After Apple no longer distributes Java as part of their release, the Java Preferences application is retired.

    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 9 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 9 to the top, makes it the default version of Java.

    If you install only Oracle Java JRE 9, then it will not appear in this list. You must install the full JDK for JRE 9 to be listed.

    Источник

    Оцените статью