I'm trying to install Java SE 6 because I need it to use Scilab, I follow this and this tutorials for uninstall java, but still cannot install Java SE 6.

When I'm trying to install appears this message You cannot install Java for macOS 2017-001 on this disk. A newer version of this package is already installed.

The command java -version in terminal shows No Java runtime present, requesting install.

  • First, try to download listed Java and if that didn't go straightway, use the following script to install it.

Here is a simpler way, an AppleScript that removes the installation limits from Java for macOS 2017-001.

set theDMG to choose file with prompt "Please select javaforosx.dmg:" of type {"dmg"}
do shell script "hdiutil mount " & quoted form of POSIX path of theDMG
do shell script "pkgutil --expand /Volumes/Java\\ for\\ macOS\\ 2017-001/JavaForOSX.pkg ~/tmp"
do shell script "hdiutil unmount /Volumes/Java\\ for\\ macOS\\ 2017-001/"
do shell script "sed -i '' 's/return false/return true/g' ~/tmp/Distribution"
do shell script "pkgutil --flatten ~/tmp ~/Desktop/Java.pkg"
do shell script "rm -rf ~/tmp"
display dialog "Modified Java.pkg saved on desktop" buttons {"Ok"}

The script asks you to select the dmg file, opens the file, unpacks JavaForOSX.pkg, modifies the Distribution file and saves a new pkg file on Desktop, Java.pkg, that can be installed on Catalina.

For those who prefer doing this directly in Terminal:

hdiutil mount /path/to/javaforosx.dmg
pkgutil --expand /Volumes/Java\ for\ macOS\ 2017-001/JavaForOSX.pkg "$t"
hdiutil unmount /Volumes/Java\ for\ macOS\ 2017-001
sed -i '' 's/return false/return true/g' "$t"/Distribution
pkgutil --flatten "$t" ~/Desktop/Java.pkg
rm -rf "$t"
open ~/Desktop/Java.pkg
  • Thank you so much! – Benjamín Paolo Díaz García Nov 25 '19 at 23:32
  • 3
    I've added a shell version for those who don't want to go via AppleScript – nohillside Nov 26 '19 at 8:47
  • 1
    That answer for terminal is pretty amazing. Just threw all that into a .sh file and it worked. Nice one. – Scott Skiles Apr 8 '20 at 14:08

there is another possibility to make Scilab work on Catalina: install an OpenJDK such the ones available at https://adoptopenjdk.net/. These JDK will allow Scilab to start on Catalina out of the box, unlike JDK from Oracle which are not AppBundle and JNI aware.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .