Thursday, March 07, 2013

Error sqoop seems to think you are running a JRE, Please install JDK


If you hit this error

13/03/07 12:31:51 ERROR orm.CompilationManager: It seems as though you are running sqoop with a JRE.
13/03/07 12:31:51 ERROR orm.CompilationManager: Sqoop requires a JDK that can compile Java code.
13/03/07 12:31:51 ERROR orm.CompilationManager: Please install a JDK and set $JAVA_HOME to use it.
13/03/07 12:31:51 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:175)
at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:83)
at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:390)
at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:476)
at org.apache.sqoop.Sqoop.run(Sqoop.java:145)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:181)
at org.apache.sqoop.Sqoop.runTool(Sqoop.java:220)
at org.apache.sqoop.Sqoop.runTool(Sqoop.java:229)
at org.apache.sqoop.Sqoop.main(Sqoop.java:238)

you need to install a package that has javac

like java-1.6.0-openjdk-devel


2 comments:

Khaja Shaik said...

Hi,

I am running Hadoop on Windows environment using CYGWIN sshd and have local MSSQL server with the database.

When i am trying to import the data from MSSQL Server into HDFS using sqoop --import command, i get below error for which you suggested to have a JDK available which is capable of compiling the Java code.

I do have the JDK installed on my machine and also specified the JAVA_HOME in the Environment variables. Also, i did export of JAVA_HOME in CYGWIN prior to running the sqoop import command but still i end with the same error.

I got the same issue even when trying to import the data from MySQL database into HDFS.

I've been struggling with this issue past 3-4 days trying to figure out the possible root cause. Also, i did not find any relevant suggestions for this on the internt forum groups.

Could you please elaborate your suggestion regarding the installation of Java JDK with clear steps as to where it should be installed for the "sqoop" process to recognize it during import for compilation. Also, is your suggestion confined to the users of Linux/ Unix system because i am using a Windows machine?...

Your suggestions would be of much help.

Below is the error message:
----------------------------
Warning: /usr/lib/hbase does not exist! HBase imports will fail.
Please set $HBASE_HOME to the root of your HBase installation.
13/03/15 19:06:32 INFO SqlServer.MSSQLServerManagerFactory: Using Microsoft's SQL Server - Hadoop Connector
13/03/15 19:06:32 INFO manager.SqlManager: Using default fetchSize of 1000
13/03/15 19:06:32 INFO tool.CodeGenTool: Beginning code generation
13/03/15 19:06:33 INFO manager.SqlManager: Executing SQL statement: SELECT TOP 1 * FROM [PERS]
13/03/15 19:06:33 INFO manager.SqlManager: Executing SQL statement: SELECT TOP 1 * FROM [PERS]
13/03/15 19:06:33 INFO orm.CompilationManager: HADOOP_HOME is C:\cygwin\usr\local\hadoop
13/03/15 19:06:33 INFO orm.CompilationManager: Found hadoop core jar at: C:\cygwin\usr\local\hadoop\hadoop-0.20.2-core.jar
13/03/15 19:06:33 WARN orm.CompilationManager: Could not find sqoop jar; child compilation may fail
13/03/15 19:06:33 ERROR orm.CompilationManager: It seems as though you are running sqoop with a JRE.
13/03/15 19:06:33 ERROR orm.CompilationManager: Sqoop requires a JDK that can compile Java code.
13/03/15 19:06:33 ERROR orm.CompilationManager: Please install a JDK and set $JAVA_HOME to use it.
13/03/15 19:06:33 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:175)
at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:83)
at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:367)
at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:453)
at org.apache.sqoop.Sqoop.run(Sqoop.java:145)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:181)
at org.apache.sqoop.Sqoop.runTool(Sqoop.java:220)
at org.apache.sqoop.Sqoop.runTool(Sqoop.java:229)
at org.apache.sqoop.Sqoop.main(Sqoop.java:238)
at com.cloudera.sqoop.Sqoop.main(Sqoop.java:57)

n said...

Try adding the location of javac in your path. I think that should work. I'm not very familiar with Windows.