Skip to content

Commit

Permalink
Give error message for those not running Java 8
Browse files Browse the repository at this point in the history
  • Loading branch information
DenWav committed Apr 23, 2016
1 parent 53a964e commit e22721a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/main/java/com/destroystokyo/paperclip/Paperclip.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ public class Paperclip {
private static MessageDigest digest;

public static void main(String[] args) {
final double version = Double.parseDouble(System.getProperty("java.specification.version"));
if (version < 1.8) {
// get mad at them
System.err.println("Paper requires Java 8, please upgrade to it.");
System.err.println("http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html");
System.exit(1);
}

try {
digest = MessageDigest.getInstance("SHA-256");
} catch (NoSuchAlgorithmException e) {
Expand Down

0 comments on commit e22721a

Please sign in to comment.