diff --git a/Formula/jsonschema2pojo.rb b/Formula/jsonschema2pojo.rb index 49525422457..32318762316 100644 --- a/Formula/jsonschema2pojo.rb +++ b/Formula/jsonschema2pojo.rb @@ -3,14 +3,18 @@ class Jsonschema2pojo < Formula homepage "http://www.jsonschema2pojo.org/" url "https://github.com/joelittlejohn/jsonschema2pojo/releases/download/jsonschema2pojo-1.0.2/jsonschema2pojo-1.0.2.tar.gz" sha256 "158e927558e3ae4779dc2b7cd00e2010e43465af5a5aebdb55c889ccacb4d6e3" + revision 1 bottle :unneeded - depends_on :java => "1.6+" + depends_on "openjdk" def install libexec.install "jsonschema2pojo-#{version}-javadoc.jar", "lib" - bin.write_jar_script libexec/"lib/jsonschema2pojo-cli-#{version}.jar", "jsonschema2pojo" + (bin/"jsonschema2pojo").write <<~EOS + #!/bin/bash + exec "#{Formula["openjdk"].opt_bin}/java" -jar "#{libexec}/lib/jsonschema2pojo-cli-#{version}.jar" "$@" + EOS end test do