Uninstalling java mac os

Uninstalling java 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.

You can determine which version of the JDK is the default by entering java -version in a Terminal window. If the installed version is 16 Interim 0, Update 0, and Patch 0, then you see a string that includes the text 16 . For example:

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 16 —exec javac -version

Installing the JDK on macOS

  1. Download the JDK .dmg file, jdk- 16 . interim.update.patch _osx-x64_bin.dmg from Java SE Downloads page.

Click Accept 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 16 Interim 0 Update 0 Patch 0:

$ rm -rf jdk- 16 .jdk

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?

3. After installing Java for macOS 2012-006, can I continue to use Apple’s Java 6 alongside the macOS JDK for Java 16 ?

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 16`

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.

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.

Источник

Uninstalling java 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.

You can determine which version of the JDK is the default by entering java -version in a Terminal window. If the installed version is 15 Interim 0, Update 0, and Patch 0, then you see a string that includes the text 15 . For example:

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 15 —exec javac -version

Installing the JDK on macOS

  1. Download the JDK .dmg file, jdk- 15 . interim.update.patch _osx-x64_bin.dmg from Java SE Downloads page.
Читайте также:  Windows не может проверит диск

Click Accept 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 15 Interim 0 Update 0 Patch 0:

$ rm -rf jdk- 15 .jdk

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?

3. After installing Java for macOS 2012-006, can I continue to use Apple’s Java 6 alongside the macOS JDK for Java 15 ?

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 14`

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.

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.

Источник

Question: Q: How do I remove Java from my Mac?

How do I completely remove Java from my Mac?

iPad 2, Mac OS X (10.6.8)

Posted on Feb 3, 2013 11:18 AM

Helpful answers

The other poster is incorrect. You absolutely may entirely remove Java from your system.

Uninstall Oracle Java 7

Uninstalling Oracle Java only involves deleting the Java Plugin file JavaAppletPlugin.plugin .

Note: To uninstall Java 7, you must have Administrator privileges.

  1. Click on the Finder icon located in your dock
  2. Click on Applications tab on the sidebar
  3. In the Search box enter JavaAppletPlugin.plugin
  4. This will find the JavaAppletPlugin.plugin file
  5. Right click on JavaAppletPlugin.plugin and select Move to Trash

From there, empty your trash. As a further measure for security, open up Safari and follow this short list of instructions;

Safari > Preferences > Security > Uncheck «Enable Java»

You can keep Enable JavaScript, as JavaScript is separate from Java and is actually needed for sites like Youtube. The only real loss of uninstalling Java is if you play Minecraft. Otherwise, 0.2% of all major websites actually use Java itself. Your computer will be safer and faster without this broken plugin. Best of luck.

Feb 22, 2013 10:18 AM

You don’t need to remove it completely. It’s deeply embedded in the system and removing it is no simple task. But if you open Java Preferences.app in Utilities, you can disable the Java Runtime Environment, which is where all the open vulnerabilities are. Just uncheck all three boxes and you’re done. You can also disable the Java plugin in the browser.

Feb 3, 2013 11:32 AM

How to uninstall Java using the Terminal:

Jun 23, 2016 5:02 AM

There’s more to the conversation

Loading page content

Page content loaded

You don’t need to remove it completely. It’s deeply embedded in the system and removing it is no simple task. But if you open Java Preferences.app in Utilities, you can disable the Java Runtime Environment, which is where all the open vulnerabilities are. Just uncheck all three boxes and you’re done. You can also disable the Java plugin in the browser.

Feb 3, 2013 11:32 AM

The other poster is incorrect. You absolutely may entirely remove Java from your system.

Uninstall Oracle Java 7

Uninstalling Oracle Java only involves deleting the Java Plugin file JavaAppletPlugin.plugin .

Note: To uninstall Java 7, you must have Administrator privileges.

  1. Click on the Finder icon located in your dock
  2. Click on Applications tab on the sidebar
  3. In the Search box enter JavaAppletPlugin.plugin
  4. This will find the JavaAppletPlugin.plugin file
  5. Right click on JavaAppletPlugin.plugin and select Move to Trash

From there, empty your trash. As a further measure for security, open up Safari and follow this short list of instructions;

Safari > Preferences > Security > Uncheck «Enable Java»

You can keep Enable JavaScript, as JavaScript is separate from Java and is actually needed for sites like Youtube. The only real loss of uninstalling Java is if you play Minecraft. Otherwise, 0.2% of all major websites actually use Java itself. Your computer will be safer and faster without this broken plugin. Best of luck.

Читайте также:  Is windows live gaming free

Feb 22, 2013 10:18 AM

Macology’s reply is incorrect. While his instructions are the official Oracle instructions they merely delete the JavaApplePlugin. That’s not an uninstall. Given (1) the ungoing security problems with Java in the browser and (2) that java -version does not report what you expect (Java Version 7 Update X), I’d love to find full uninstlall directions. Oh. want to make sure you’re secure, turn it back on in the browsers. Uhm. right.

Apr 23, 2013 12:15 PM

You are incorrect. If you follow the instructions I have given and leave JavaScript disabled, any attempt to use a Java based site will result in being told that you need Java installed. And JavaScript is separate from Java itself. Do not spread fear, uncertainty, doubt and misinformation n these forums. People here need assistance, lies about being unable to remove third party software. Java is currently locked by default by Apple. So if a user opts to install it anyways, this is the method to remove it.

Apr 24, 2013 8:42 AM

In the Terminal window Copy and Paste the command below:

Apr 25, 2013 4:59 PM

This nukes it once and for all. Better to move it Disabled Plug-ins, same location, in case it is ever needed in the future. Besides, that’s just an alias. It doesn’t remove the original.

Apr 26, 2013 3:56 AM

After trying various things suggested, here’s what I’ve found (basically a summary of the above with a few additional details)

You can disable it in the browser (presumably all) by going to System Preferences > Java

Deleting the JavaAppletPlugin (another approach above) may do something similar or may block more Java items from running

A full uninstall is much more complicated (e.g. on my system, you’re removing around 4k items). BUT, when I did a test (by adding .disabled on the end of several key java folders) —while I didn’t find OS X complaining— I immediately found programs that wouldn’t function. The most surprising is Creative Suite. Starting Photoshop (I think) resulted in it saving java is required. My experiment in being Java free was very very brief.

FWIW, the way I’m managing things is that I keep Java turned off in all the browsers (Chrome and Safari) I use regularly. Safari is my, dag nab it, I have to go site X that uses Flash|Java|Dumb plugin browser.

AND then, I only use that browser when I need to go to one of those sites. There’s still some security risk but my exposure is a lot lower. The why Safari isn’t really relevent beyond saying I picked the browser I didn’t need for other stuff.

Finally (and I wish I could remember where I found this), there are some pretty hardcore security settings possible. Whereve I found it, I’ve got Java asking permission every time a Java applet tries to run in the browser. Slightly annoying but not likely a rogue applet is going to run without my knowledge.

Hopefullly that adds more to the light everyone has shed on the subject.

Источник

How To Install / Uninstall Multiple Java Versions In Mac OS By Home Brew Or Manually

This article will tell you how to install/uninstall multiple java versions on mac os both use homebrew or manually. It also shows you how to set JAVA_HOME & PATH system environment variable to make your installed JDK as the default JDK. We recommend you to use homebrew because it provides a lot of easy-to-use tools.

1. Use HomeBrew To Install & Uninstall Java On Mac OS X.

1.1 Use HomeBrew Cask Command To Install Java JDK.

  1. Install HomeBrew on your mac os, please read the article How To Install HomeBrew On Mac OS.
  2. Run the below command to install the homebrew cask extension, cask extension tool can help you to install and manage software packages easily.
  3. Run brew search java or brew search jdk command to find your desired java or JDK version. Below is the search result for the command brew search java .

Below is the search result for the command brew search jdk .

Now install the JDK version that you need like below. During the installation process, you may encounter some error messages like Error: Cask ‘java8’ is unavailable: No Cask with this name exists or Error: Cask adoptopenjdk8 exists in multiple taps.

  • Below is the correct command to install JDK 8 use the homebrew cask command ( $ brew cask install homebrew/cask-versions/adoptopenjdk8 ). You can also run $ brew cask install java to install the newest JDK version. In this example, I had installed the newest JDK version 12.0.1.
  • After install you can first run the command /usr/libexec/java_home to get the java home directory, then go to the JDK home directory to see all the installed JDK.
  • From the above output, we can see that there are three java JDK that has been installed, two open JDK, and one standard JDK. Run each JDK’s java executable command, you can get the below output.
  • Читайте также:  Linux информация по железу

    1.2 Use HomeBrew Cask Command To UnInstall JDK.

    1. Run homebrew cask command $ brew cask uninstall java to uninstall open JDK 12.0.1. If you want to uninstall open JDK 8 then run $ brew cask uninstall caskroom/versions/adoptopenjdk8 .
      Below command uninstall open JDK 12.0.1.

    Below command uninstall open JDK 8.

    During the above JDK uninstall process, you may encounter the below error, Error: Cask adoptopenjdk8 exists in multiple taps. This is because you should uninstall caskroom/versions/adoptopenjdk8 instead of adoptopenjdk8.

  • Now go to JDK installation directory, you will find above two homebrew installed JDK directory has been removed.
  • 2. Install & Uninstall JDK In Mac OS Manually.

    2.1 Install JDK Manually In Mac OS X.

    1. Download related JDK from oracle JDK download page. You should have an oracle account to log in before the download start.
    2. Double click the downloaded dmg file to install JDK, just follow the wizard to install it.
    3. When the installation complete, you can find the JDK install directory in folder /Library/Java/JavaVirtualMachines/. From the below output, we can see there are three JDK that has been installed, one ( adoptopenjdk-8.jdk ) is installed with homebrew, the other two ( jdk-12.0.1.jdk, jdk1.8.0_211.jdk ) are installed by download installation file from oracle.

    2.2 Uninstall Java JDK Manually In Mac OS X.

    Follow oracle’s documents, to manually uninstall installed JDK in mac os x, you just need to remove some files with root permission in the terminal like below.

      1. Open a terminal and run the below command to remove the java JDK installed directory.
      2. Run the below command to remove the java control panel if exist.
      3. Remove java applet plugins.
      4. Remove java application support.
      5. Remove the java updater list.
      1. Remove the java helper tool.

    3. Set JAVA_HOME & PATH System Environment Variable.

    Now we have known how to install/uninstall multiple java JDK versions on mac os. But after that, you need to set JAVA_HOME & PATH environment variable value to set your installed JDK as default JDK. So that you can use it easily.

    1. Run the below command in a terminal to go to the user home directory.
    2. Run $ vim .bash_profile command to open .bash_profile file to edit.
    3. Press esc then press i to enter insert mode and insert the below export command in .bash_profile file.
    4. Press esc then :wq! to save the above changes and quit the vim editor.
    5. Run $ source .bash_profile command to make the above changes take effect.
    6. Now run $ java -version , you can see the new JDK version is used by output info.

    4. Question & Answer.

    4.1 How to manage multiple JDK versions on mac OS X use SDKMAN .

    1. My macOS is Catalina Version 10.15.7, and I run the command /usr/libexec/java_home -verbose to find all the installed JDK versions. I installed JDK 12.0.1 and OpenJDK 1.8.0.

    Now I want to install and manage more other JDK versions in it, how to manage the multiple JDK versions, thanks.

  • You can use SDKMAN to manage multiple JDK versions. The SDKMAN supports all Unix-style OS. Open a terminal and run the command curl -s «https://get.sdkman.io» | bash to install it.
  • Open a new terminal and run the command $ source «$HOME/.sdkman/bin/sdkman-init.sh» to initialize the SDKMAN.
  • Run the command $ sdk version to verify the SDKMAN version and make sure it is installed successfully.
  • Now you can run the command $ sdk list java to list all the available JDK versions you can install and manage with SDKMAN.
  • Run the command $ sdk install java jdk-identifier to install the JDK from the above list. You can find the JDK identifier from the last column of the list.
  • We can install two JDK versions, so we run the command $ sdk install java 15.0.2.7.1-amzn to install an amazon provided JDK.
  • When the installation complete, you can find the SDKMAN installed JDK in the directory

    You can switch to use one JDK with the command $ sdk use java java-identifier .

  • You can also use SDKMAN to manage your existing JDK.
  • First, get your existing JDK installed path with the command $ /usr/libexec/java_home -verbose .
  • What you need to do is just give your existing JDK a label in SDKMAN with the command $ sdk install java local-jdk-tag local-jdk-install-path .
  • Now you can run the command $ sdk use java local-jdk-tag to use your local JDK version.
  • Now you can run the command env to find that SDKMAN has manipulated the JAVA_HOME system environment for you automatically.
  • You can also find the SDKMAN_DIR and SDKMAN_CANDIDATES_DIR in the system environment variables.
  • Источник

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