cask "java@beta" do arch arm: "aarch64", intel: "x64" version "24,24" sha256 arm: "7893fcd2220eef48eed090de010357d57287456a14680fd85b7bb304c9e4ab0f", intel: "f5a046b5a66c75f3e6fbaaf2e80e67d627eb0bc091cd7ef85b819d7e825a8fbf" url "https://download.java.net/java/early_access/jdk#{version.major}/#{version.csv.second}/GPL/openjdk-#{version.csv.first}-ea+#{version.csv.second}_macos-#{arch}_bin.tar.gz" name "OpenJDK Early Access Java Development Kit" desc "Early access development kit for the Java programming language" homepage "https://jdk.java.net/" livecheck do url "https://jdk.java.net/#{version.major}/" regex(%r{href=.*?/GPL/openjdk-(\d+)-ea\+(\d+)_macos-#{arch}_bin\.t}i) strategy :page_match do |page, regex| page.scan(regex).map { |match| "#{match[0]},#{match[1]}" } end end artifact "jdk-#{version.csv.first}.jdk", target: "/Library/Java/JavaVirtualMachines/openjdk-#{version.csv.first}.jdk" zap trash: "~/Library/Saved Application State/net.java.openjdk*.savedState" end