diff --git a/appveyor.yml b/appveyor.yml
index b3e62b24b7fb96cbdc87687b88d2ef0ed7253402..a00843bc1f41ad27097f5ab2c2e021afbcdad2a8 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -25,6 +25,7 @@ environment:
       LIBEWF_HOME: "C:\\libewf_64bit"
       POSTGRESQL_HOME_64: "C:\\Program Files\\PostgreSQL\\9.5"
       PYTHON: "C:\\Python36-x64"
+      JDK_HOME: C:\Program Files\Java\jdk1.8.0
 services:
       - postgresql95;
 
diff --git a/setupLibs.py b/setupLibs.py
index e11adf3464909e747f5d74e5b1c93315aa701c62..da58702b806106e37d0ec4da19f6499d0aebb654 100644
--- a/setupLibs.py
+++ b/setupLibs.py
@@ -39,17 +39,18 @@ def main():
         base_Library_path["libewf_64bit"] = os.path.dirname(libewf_home)
     else:
         print('Please set the env variable LIBEWF_HOME')
+        sys.exit(1)
 
     if(libvhdi_home != None):
         base_Library_path["libvhdi_64bit"] = os.path.dirname(libvhdi_home)
     else:
         print('Please set the env variable LIBVHDI_HOME')
-
+        sys.exit(1)
     if(libvmdk_home != None):
         base_Library_path["libvmdk_64bit"] = os.path.dirname(os.path.dirname(libvmdk_home))
     else:
         print('Please set the env variable LIBVMDK_HOME')
-
+        sys.exit(1)
 
     setupLibrary(base_Library_path);
 
diff --git a/win32/updateBuildLibs.py b/win32/updateBuildLibs.py
index 8c083b3a46f48e53df60c19360687fa337e763da..9a04d61a2c775b5bb455b7f121d843fbf65bffe3 100644
--- a/win32/updateBuildLibs.py
+++ b/win32/updateBuildLibs.py
@@ -213,6 +213,7 @@ def buildTSK(wPlatform, target):
 
     if not TSK_HOME:
         print("Please set the TSK_HOME environment variable")
+        sys.exit(1)
     else:
         os.chdir(os.path.join(os.getenv("TSK_HOME"),"win32"))