diff --git a/doctor.rb b/doctor.rb index 045f01a..43b7905 100644 --- a/doctor.rb +++ b/doctor.rb @@ -10,6 +10,7 @@ def execute silent = true else @errors = [] verify_swift + verify_java verify_community_templates verify_community_commands print_environment_info unless silent @@ -177,6 +178,22 @@ def swift_staged? def swift_runtime? Dir["#{xcode_frameworks_path}/libswift*.dylib"].any? end + + def verify_java + unless java? + @errors << <<-S +Java Development Kit (JDK) 1.8 is not installed. +To fix this error, download here: + + https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html +S + end + end + + def java? + `/usr/libexec/java_home -F -v 1.8` + $?.success? + end def verify_community_templates unless rubymotion_templates?