-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathopenjdk-11.rb
36 lines (30 loc) · 934 Bytes
/
openjdk-11.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
class Openjdk11 < Formula
desc "Java Development Kit"
homepage "https://jdk.java.net/11/"
# tag origin homebrew-core
# tag derived
version "11.0.2"
url "https://download.java.net/java/GA/jdk11/9/GPL/openjdk-11.0.2_linux-x64_bin.tar.gz"
sha256 "99be79935354f5c0df1ad293620ea36d13f48ec3ea870c838f20c504c9668b57"
bottle :unneeded
keg_only "this would clash with other JDKs (and java is selected via jenv anyway)"
depends_on :linux
def install
prefix.install Dir["*"]
share.mkdir
end
test do
(testpath/"Hello.java").write <<~EOS
class Hello
{
public static void main(String[] args)
{
System.out.println("Hello Homebrew");
}
}
EOS
system bin/"javac", "Hello.java"
assert_predicate testpath/"Hello.class", :exist?, "Failed to compile Java program!"
assert_equal "Hello Homebrew\n", shell_output("#{bin}/java Hello")
end
end