본문 바로가기

카테고리 없음

Installing Mac Dmg File Terminal



May 29, 2017  After accepting the license agreement, choose the Mac OS X file under the Java SE Development Kit section to begin the download. Once the.dmg file has downloaded, open it. Double click on the package installer icon. The Java installer should appear - click through to install Java. After installing 7-Zip, you can simply double-click a DMG file to open it and browse its contents. If you’d like to extract the files from the DMG so they’re easier to work with, right-click the DMG file, point to the “7-Zip” menu, and then choose one of the extraction options. Jul 20, 2017 DMG files are mounted by your system, like a sort of virtual hard drive. When you’re done installing the application, it’s a good idea to unmount the DMG in Finder when you’re done installing: just click the “Eject” arrow. Then you can feel free to delete the original DMG file: you don’t need it anymore. Nov 30, 2012  A protip by afgomez about osx and bash. I created a bash piece of code that downloads a.dmg, mounts it and copies the.app folder into your /Applications folder. The usage is really simple $ dmginstall url For example, for installing alfred.app.

Rated (3.9 of 5.0) by 7 reviewers.
Kelly Heffner Wilkerson
November 8, 2019 at 6:30 AM
Categories: macOS | View Comments


I ran into an interesting macOS error while working with a customer a couple of weeks ago. I didn't find a lot of good search results addressing the issue, so I decided to write up a post about it myself.

The error was as the screenshot above shows; trying to open a dmg (disk image), macOS showed the error 'no mountable file systems'. If you see the 'no mountable file systems error' while opening a dmg, here's what you should try:

  1. In most cases, the downloaded dmg file is actually corrupt or had an error downloading. If possible, try downloading the dmg again, turning off any download assistant plug-ins you may have. You can try downloading the file in a different browser as well. Or if you don't need to be logged in to the site to download the file and you want to be fancy, you can try curl -O url in Terminal to download the file. (There's an example of that in my screenshot below.)

  2. Reboot your Mac if you haven't already tried that. Apparently there is an issue sometimes after opening too many dmg files, that is fixed with a reboot.

  3. Try mounting the DMG on the command line in Terminal. We will at least get some sort of useful error message to go on if it still fails:

    • Open Terminal: In Spotlight, the search magnifying glass at the upper right corner of your screen, search for Terminal, and press enter to open the Terminal app.

    • Type hdiutil attach -verbose into the terminal. Add a space at the end, but don't press enter yet.

    • Drag the dmg file from your Finder window onto the Terminal window and let go. This will fill in the location of the dmg file into your Terminal window.

    • Press enter.
  4. macOS Sierra (10.12) and earlier is not able to mount the new Apple File System (APFS). So if you're on macOS Sierra (10.12) or earlier and you ran hdiutil and see references to Apple_APFS or error 112, the issue is likely legitimate incompatibility, and this disk image won't open on this Mac without an update to the operating system.

    Here's an example of the end of hdiutil attach -verbose output that shows an APFS error due to an older version of macOS:

  5. Think about if you have any kind of security policies on this machine to prevent writing to external drives (thumb drives, optical drives, etc). I haven't seen this one in action, but I read about this being a possibility while researching the issue.

  6. Another suggestion added by a reader (thank you, Markus!) is that filesystem errors on your main Mac drive could be the cause of the disk image mounting errors. Here are instructions from Apple for scanning and repairing errors using Disk Utility. Note that in order to scan and repair errors on your main Macintosh HD drive, you'll need to reboot your Mac into recovery mode. You'll want to choose Disk Utility in the utilities listed in the recovery mode menu.

  7. A new discovery from a reader (thank you, Colby!) is that APFS DMGs won't mount if you're booted in macOS booted in Safe Mode. (Who knew!?!) If you're not sure if you're in safe mode, select the Apple menu  > About This Mac > System Report button, then select the 'Software' heading from the left column. To exit safe mode, restart your Mac, without holding Shift during startup. Or, if you previously set your Mac to always boot into safe mode using nvram, turn off safe mode and have your Mac boot normally on the terminal:

    • Open Terminal: In Spotlight, the search magnifying glass at the upper right corner of your screen, search for Terminal, and press enter to open the Terminal app.

    • Type/paste sudo nvram boot-args=' and press enter.

    • Restart your Mac.

This topic includes the following sections:

System Requirements for Installing the JDK on macOS

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

  • Any Intel-based computer running macOS.

  • Administrator privileges.

    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.

There can be multiple JDKs installed on the macOS system.

You can determine which version of the JDK is the default by entering java -version in a Terminal window. If the installed version is 13 Interim 0, Update 0, and Patch 0, then you see a string that includes the text 13. 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 13 --exec javac -version

Installing the JDK on macOS

Installing Mac Dmg File Terminal Mac

  1. Download the JDK .dmg file, jdk-13.interim.update.patch_osx-x64_bin.dmg.

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

  2. From either the browser Downloads window or from the file browser, double-click the .dmg file to start it.
    A Finder window appears that contains an icon of an open box and the name of the .pkg file.
  3. Double-click the JDK 13.pkg icon to start the installation application.
    The installation application displays the Introduction window.
  4. Click Continue.
  5. Click Install.
    A window appears that displays the message: Installer is trying to install new software. Enter your password to allow this.
  6. Enter the Administrator user name and password and click Install Software.
    The software is installed and a confirmation window is displayed.
After the software is installed, you can delete the .dmg file if you want to save disk space.

Uninstalling the JDK on macOS

InstallingYou must have Administrator privileges.

Note:

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:
    /Library/Java/JavaVirtualMachines/jdk-13.interim.update.patch.jdk

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

    $ rm -rf jdk-13.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?

See Uninstalling the JDK on macOS.

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

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:

Installing Mac Dmg File Terminal 2

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

Installing Mac Dmg File Terminal 1

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.

Installing Mac Dmg File Terminal 3

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

Mac Dmg File

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.