sqoop 1.4.6导数据报错,It seems as though you are running sqoop with a JRE
[root@master bin]# sqoop import -m 1 --connect jdbc:mysql://master:3306/mysql --username root --password Mysql5718% --table user --target-dir /user/hdfs/testdata/
Warning: /opt/sqoop1.4.6/../hcatalog does not exist! HCatalog jobs will fail.
Please set $HCAT_HOME to the root of your HCatalog installation.
Warning: /opt/sqoop1.4.6/../accumulo does not exist! Accumulo imports will fail.
Please set $ACCUMULO_HOME to the root of your Accumulo installation.
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/hbase/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/hbase/lib/spark-assembly-1.6.3-hadoop2.4.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/hbase/lib/spark-examples-1.6.3-hadoop2.4.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
17/11/26 11:24:19 INFO sqoop.Sqoop: Running Sqoop version: 1.4.6
17/11/26 11:24:19 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead.
17/11/26 11:24:19 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset.
17/11/26 11:24:19 INFO tool.CodeGenTool: Beginning code generation
17/11/26 11:24:20 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM `user` AS t LIMIT 1
17/11/26 11:24:20 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM `user` AS t LIMIT 1
17/11/26 11:24:20 INFO orm.CompilationManager: HADOOP_MAPRED_HOME is /usr/hadoop
17/11/26 11:24:20 ERROR orm.CompilationManager: It seems as though you are running sqoop with a JRE.
17/11/26 11:24:20 ERROR orm.CompilationManager: Sqoop requires a JDK that can compile Java code.
17/11/26 11:24:20 ERROR orm.CompilationManager: Please install a JDK and set $JAVA_HOME to use it.
17/11/26 11:24:20 ERROR tool.ImportTool: Encountered IOException running import job: java.io.IOException: Could not start Java compiler.
at org.apache.sqoop.orm.CompilationManager.compile(CompilationManager.java:187)
at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:108)
at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:478)
at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:605)
at org.apache.sqoop.Sqoop.run(Sqoop.java:143)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:179)
at org.apache.sqoop.Sqoop.runTool(Sqoop.java:218)
at org.apache.sqoop.Sqoop.runTool(Sqoop.java:227)
at org.apache.sqoop.Sqoop.main(Sqoop.java:236)
[root@master bin]# java -version
java version "1.7.0_79"
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)
[root@master bin]# which java
/usr/java/jdk1.7.0_79/bin/java
[root@master bin]#
查看JDK版本,也没问题,哪位大神知道原因,指点下,拜谢!