public final class JdkUtils extends Object
Modifier and Type | Method and Description |
---|---|
static int |
getMajorJavaVersion()
Get the major Java version.
|
static File |
getToolsJar()
Returns the file containing the JDK tools (such as the compiler).
|
static File |
getToolsJar(String javaHome)
Returns the file containing the JDK tools (such as the compiler) for the specified Java
installation.
|
static boolean |
isOSX()
Is the user running on a Macintosh OS X system? Heuristic derived from Apple Tech Note
2042.
|
static boolean |
isWindows()
Is the user running on a Windows system?
|
static int |
parseMajorJavaVersion(String version)
Parse major Java version from a Java version string.
|
static void |
sleep(long ms)
Pauses the current thread for the specified amount.
|
public static File getToolsJar() throws FileNotFoundException
FileNotFoundException
- If the tools.jar file could not be foundpublic static File getToolsJar(String javaHome)
tools.jar
file
on that platform (everything is included in classes.jar
).javaHome
- The installation directory of the JRE/JDK for which to locate the JDK tools,
must not be null
.tools.jar
file, never
null
.public static boolean isOSX()
public static boolean isWindows()
public static int getMajorJavaVersion()
public static int parseMajorJavaVersion(String version)
version
- Java version string.public static void sleep(long ms)
ms
- The time to sleep in millisecondsCopyright © 2004–2018 Github. All rights reserved.