01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tc;
05:
06: import org.apache.commons.lang.StringUtils;
07:
08: public class CheckJavaVersion {
09: public static void main(String[] args) {
10: if (args.length != 1) {
11: throw new IllegalArgumentException(
12: "Requires single argument: 'MajorVersion.MinorVersion'");
13: }
14: String targetVersion = args[0];
15: String vmVersion = System.getProperty("java.version");
16: System.exit(StringUtils.contains(vmVersion, targetVersion) ? 0
17: : -1);
18: }
19: }
|