cask "microsoft-openjdk@17" do arch arm: "aarch64", intel: "x64" version "17.0.13" sha256 arm: "e322c84f5220bc3c781862f58a72797687ceee2a11ea9d6f7eed6f081fffdce0", intel: "61383a916fd73ad012867f83b005d2e94276629c45b5e0c99115402d24002aa4" url "https://aka.ms/download-jdk/microsoft-jdk-#{version}-macos-#{arch}.pkg", verified: "aka.ms/download-jdk/" name "Microsoft Build of OpenJDK" desc "OpenJDK distribution from Microsoft" homepage "https://microsoft.com/openjdk" livecheck do url "https://docs.microsoft.com/java/openjdk/download" regex(%r{href=.*?/microsoft[._-]jdk[._-]v?(17(?:\.\d+)+)[._-]macOS[._-]#{arch}\.pkg}i) end pkg "microsoft-jdk-#{version}-macOS-#{arch}.pkg" uninstall pkgutil: "com.microsoft.#{version.major}.jdk" zap trash: [ "~/Library/Preferences/net.java.openjdk.java.plist", "~/Library/Saved Application State/net.java.openjdk.java.savedState", ] end