Invalid JDK example

Add an example to check that an invalid JDK results in "exit 1".

Also, ensure the .jdk directory used in the examples is created in the temporary directory rather than in the current directory and is therefore cleaned up correctly.