5
0
mirror of https://github.com/apache/sqoop.git synced 2025-05-03 23:22:51 +08:00

SQOOP-10. Provide a useful error message when a Java compiler cannot be found.

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149938 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Andrew Bayer 2011-07-22 20:04:04 +00:00
parent f56de22b7a
commit 0fcbcd759a

View File

@ -169,6 +169,12 @@ public void compile() throws IOException {
args.add(curClasspath + File.pathSeparator + coreJar + sqoopJar);
JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
if (null == compiler) {
LOG.error("It seems as though you are running sqoop with a JRE.");
LOG.error("Sqoop requires a JDK that can compile Java code.");
LOG.error("Please install a JDK and set $JAVA_HOME to use it.");
throw new IOException("Could not start Java compiler.");
}
StandardJavaFileManager fileManager =
compiler.getStandardFileManager(null, null, null);