mirror of
https://github.com/apache/sqoop.git
synced 2025-05-04 01:19:38 +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:
parent
f56de22b7a
commit
0fcbcd759a
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user