Problem with Java home

Nipponho

Senior Member
Joined
Nov 18, 2011
Messages
647
Reaction score
10
Hi,

I am having difficulties starting HBase in linux.

Book’s instruction to amend the environmental variables file hbase-env.sh in HBase like this :

# Tell HBase whether it should manage its own instance of Zookeeper or not.
export HBASE_MANAGES_ZK=true
# The java implementation to use. Java 1.6 required.
export JAVA_HOME=/opt/ibm/biginsights/jdk


It also says :

In the listing, we’ve also set the JAVA_HOME environment variable to point to the IBM JDK we have on our system. You’ll have to make sure you set JAVA HOME to point to your chosen JDK.

I do not have IBM Biginsights in my opt folder. Biginsights is a commercial distro, not a freeware. As a result, I am having this error message when I try to start HBase :

java%20error.jpg
[/URL][/IMG]

I tried to point it to /etc/java folder but it doesn’t work.

How should I solve this problem? Where else can I export Java Home to?

Thanks!
 

davidktw

Arch-Supremacy Member
Joined
Apr 15, 2010
Messages
13,549
Reaction score
1,302
Hi,

I am having difficulties starting HBase in linux.

Book’s instruction to amend the environmental variables file hbase-env.sh in HBase like this :

# Tell HBase whether it should manage its own instance of Zookeeper or not.
export HBASE_MANAGES_ZK=true
# The java implementation to use. Java 1.6 required.
export JAVA_HOME=/opt/ibm/biginsights/jdk


It also says :

In the listing, we’ve also set the JAVA_HOME environment variable to point to the IBM JDK we have on our system. You’ll have to make sure you set JAVA HOME to point to your chosen JDK.

I do not have IBM Biginsights in my opt folder. Biginsights is a commercial distro, not a freeware. As a result, I am having this error message when I try to start HBase :

java%20error.jpg
[/URL][/IMG]

I tried to point it to /etc/java folder but it doesn’t work.

How should I solve this problem? Where else can I export Java Home to?

Thanks!

Go install a copy of Java SDK or JDK Version 1.6 and above, then export the variable JAVA_HOME pointing to the "JDK" directory will do. you don't necessarily require a IBM implementation of JDK, the Oracle one should work just fine.
 

Rock-kun

Senior Member
Joined
Sep 10, 2007
Messages
991
Reaction score
1
Go install a copy of Java SDK or JDK Version 1.6 and above, then export the variable JAVA_HOME pointing to the "JDK" directory will do. you don't necessarily require a IBM implementation of JDK, the Oracle one should work just fine.

Can't he just use the distribution's package manager to install OpenJDK from the repositories and let the package scripts automatically handle the Java bin and lib paths? That sounds like an easier solution that avoids messing with 'export JAVA_HOME' unless HBase does not play nice with OpenJDK.
 

davidktw

Arch-Supremacy Member
Joined
Apr 15, 2010
Messages
13,549
Reaction score
1,302
Can't he just use the distribution's package manager to install OpenJDK from the repositories and let the package scripts automatically handle the Java bin and lib paths? That sounds like an easier solution that avoids messing with 'export JAVA_HOME' unless HBase does not play nice with OpenJDK.

Up to the user seriously. No issue these days using OpenJDK. However knowing JAVA_HOME is not messing around with Java. Developers MUST know and understand these stuff. JAVA_HOME variable is a critical part of knowing Java.
 

Rock-kun

Senior Member
Joined
Sep 10, 2007
Messages
991
Reaction score
1
Developers MUST know and understand these stuff. JAVA_HOME variable is a critical part of knowing Java.

But then you'd still have to append the bin directory to PATH. I have found that sometimes just declaring JAVA_HOME does not work without making the addition to PATH if Oracle JDK and OpenJDK lives on the same system.
 

davidktw

Arch-Supremacy Member
Joined
Apr 15, 2010
Messages
13,549
Reaction score
1,302
But then you'd still have to append the bin directory to PATH. I have found that sometimes just declaring JAVA_HOME does not work without making the addition to PATH if Oracle JDK and OpenJDK lives on the same system.

PATH and JAVA_HOME variables are for very different purposes and owned by different part of a solution. PATH is a Shell owned variable. It is interpreted by the Shell to search for executables for execution in the event the command is not a built in command or aliases or function. Without the correct value in PATH, the shell wouldn't even search the current directory for commands that can be executed

JAVA_HOME environment variable is a conformance used among Java applications. It is not a conformance established in Unices Shell. It is normally used by Java technologies to know the PREFIX to a JDK or JRE installation, so that if there is necessarily to load other Java libraries or configuration, applications like Weblogic, Tomcat, Eclipse, or even HBase will know where to start the search.

You will need PATH environment variable if you do not want to specific explicit file path to your executables, and you may or may not require JAVA_HOME depending on how your Java application bootstrapping process works. Providing explicit JAVA_HOME environment variable normally overwrites auto detection in bootstrapping scripts and especially useful if you have more than one version of Java runtime in the same system.
 

Nipponho

Senior Member
Joined
Nov 18, 2011
Messages
647
Reaction score
10
hi David & rock-kun, thanks so much for your replies.

i found the jdk folder in /root/jdk1.8.0_91/

I amended the hbase-env.sh file to ““export JAVA_HOME=/root/jdk1.8.0_91” and the error message disappeared.

I am not using distros. What i downloaded is the original HBase. I spent some time learning linux and I realised i can use linux's GUI and firefox application and go to Apache wbesite to re-download. Download using firefox is so easy, almost exactly like in Windows. Before this, i followed the stupid book's method of using the command line, repos and yum give me so much problems and headaches and a lot of files are missing.
 

davidktw

Arch-Supremacy Member
Joined
Apr 15, 2010
Messages
13,549
Reaction score
1,302
hi David & rock-kun, thanks so much for your replies.

i found the jdk folder in /root/jdk1.8.0_91/

I amended the hbase-env.sh file to ““export JAVA_HOME=/root/jdk1.8.0_91” and the error message disappeared.

I am not using distros. What i downloaded is the original HBase. I spent some time learning linux and I realised i can use linux's GUI and firefox application and go to Apache wbesite to re-download. Download using firefox is so easy, almost exactly like in Windows. Before this, i followed the stupid book's method of using the command line, repos and yum give me so much problems and headaches and a lot of files are missing.

If you are keen to polish your craft as a software engineer, you will want to force yourself to be able to function with command line only. There are advantages being able to function with only command line and doesn't always have to resort to GUI. Commandline is way more powerful than GUI which is limiting at times. Commandline can be tedious for some work, but it does give you access to areas where GUI can't. So don't be too reliant on GUI to work.
 

ykgoh

Master Member
Joined
Jan 1, 2000
Messages
2,782
Reaction score
0
hi David & rock-kun, thanks so much for your replies.

i found the jdk folder in /root/jdk1.8.0_91/

I amended the hbase-env.sh file to ““export JAVA_HOME=/root/jdk1.8.0_91” and the error message disappeared.

I am not using distros. What i downloaded is the original HBase. I spent some time learning linux and I realised i can use linux's GUI and firefox application and go to Apache wbesite to re-download. Download using firefox is so easy, almost exactly like in Windows. Before this, i followed the stupid book's method of using the command line, repos and yum give me so much problems and headaches and a lot of files are missing.

repos and yum are similar to smartphone app store concept, you define a centralised location (usually a HTTP server URL) from where you search and download software from. Usually you either edit a configuration file, or need to run a setup script/program.

Usually common problems with instructions are due to:
  1. Software version leading to slight change in URL and filename.
  2. Different directory and file location due to different Linux distro.

So when typing any commands, understand what it is and adapt accordingly. If a file or directory is not found or URL is broken, could it be the filename has changed? Many software likes to include its version in the name.

Using wget and curl is equivalent to using Firefox to download from the GUI.

In IT world, any printed book is outdated within 3 to 6 months.
 

Nipponho

Senior Member
Joined
Nov 18, 2011
Messages
647
Reaction score
10
Actually, my present objective is to learn to be a user. I don't dare to aim for software engineer or developer although it would be wonderful if this can be achieved.

The book on hadoop taught us using the original hadoop which does not have GUI, and so i was forced to pick up another book on linux so that i can understand the commands. Reading 2 books similataneously. Still a lot of problems i cannot solve and i gave up and switched to an online course which taught us using IBM's Hadoop distro. Goodness, to my delight, the distro's GUI is so wonderful, absolutely no linux knowledge or commands knowledge required. The menus and icons are so intuitive.

But the book also say the same thing. That commands are more powerful than GUI. So i hope my little knowledge on commands will become useful one day. At least for now, i can tell people i ever touch linux before. :)
 
Important Forum Advisory Note
This forum is moderated by volunteer moderators who will react only to members' feedback on posts. Moderators are not employees or representatives of HWZ Forums. Forum members and moderators are responsible for their own posts. Please refer to our Community Guidelines and Standards and Terms and Conditions for more information.
Top