Re-configuring java environmental variables for Hadoop ecosystem - hadoop

I'm trying to install Scala IDE 4.7 in my Cloudera VM 5.10, Which is preconfigured with JDK 1.7, Spark 1.6 version respectively.
So, I have installed jdk version 1.8 in /opt/ location by uninstalling the default JDK located at /usr/java/jdk1.7 given by Cloudera. I added the java environment variables in .bash_profile. I was successfully able to install Scala IDE.
But now all the ecosystem of Hadoop are pointing towards old JDK 1.7 which I have uninstalled and throws an error when running. Can anyone let me know where I can config java variables for Hadoop ecosystem to work with new 1.8 JDK?
Here is the screen shot for reference

Step 1: Stop all the hadoop servers
Step 2: edit bigtop-utils file.
I've added the location of jdk 1.8.
Create a variable BIGTOP_MAJOR = 8.
the order of preference for it to choose the jdk is 6,7,8 and open JDK.
Step 3: save and reboot.

Related

How to install OpenJDK 11 on Windows?

In the past, Oracle used to publish an executable installers for Windows that would:
Unpack files
Add registry keys indicating the installed version and path
Add the JRE to the system PATH
Register an uninstaller with Windows.
As of Java 11, the Oracle's free version of Java (Oracle OpenJDK) doesn't seem to include an installer. It is just a zip file containing the binaries.
How are we supposed to install OpenJDK 11 on Windows seeing as the aforementioned integrations are no longer there? Aren't they necessary?
Extract the zip file into a folder, e.g. C:\Program Files\Java\ and it will create a jdk-11 folder (where the bin folder is a direct sub-folder). You may need Administrator privileges to extract the zip file to this location.
Set a PATH:
Select Control Panel and then System.
Click Advanced and then Environment Variables.
Add the location of the bin folder of the JDK installation to the PATH variable in System Variables.
The following is a typical value for the PATH variable: C:\WINDOWS\system32;C:\WINDOWS;"C:\Program Files\Java\jdk-11\bin"
Set JAVA_HOME:
Under System Variables, click New.
Enter the variable name as JAVA_HOME.
Enter the variable value as the installation path of the JDK (without the bin sub-folder).
Click OK.
Click Apply Changes.
Configure the JDK in your IDE (e.g. IntelliJ or Eclipse).
You are set.
To see if it worked, open up the Command Prompt and type java -version and see if it prints your newly installed JDK.
If you want to uninstall - just undo the above steps.
Note: You can also point JAVA_HOME to the folder of your JDK installations and then set the PATH variable to %JAVA_HOME%\bin. So when you want to change the JDK you change only the JAVA_HOME variable and leave PATH as it is.
Java 17 (LTS) and up
For Java 17 and up, you can use the Eclipse Adoptium website. According to their about section, the Eclipse Adoptium project is the continuation of the original AdoptOpenJDK mission.
Java 11 (LTS), Java 8 - 16
For Java 11 (8 through 16), you can use AdoptOpenJDK, a website hosted by the java community. You can find .msi installers for OpenJDK 8 through 16 there, which will perform all the things listed in the question (Unpacking, registry keys, PATH variable updating (and JAVA_HOME), uninstaller...).
Use the Chocolatey packet manager. It's a command-line tool similar to npm. Once you have installed it, use
choco install openjdk --version=11.0
in an elevated command prompt to install OpenJDK 11 (leave out the --version parameter to install the latest version).
To update an installed version to the latest version, type
choco upgrade openjdk
Pretty simple to use and especially helpful to upgrade to the latest version. No manual fiddling with path environment variables.
From the comment by #ZhekaKozlov: ojdkbuild has OpenJDK builds (currently 8 and 11) for Windows (zip and msi).
You can use Amazon Corretto. It is free to use multiplatform, production-ready distribution of the OpenJDK. It comes with long-term support that will include performance enhancements and security fixes. Check the installation instructions here.
You can also check Zulu from Azul.
One more thing I like to highlight here is both Amazon Corretto and Zulu are TCK Compliant. You can see the OpenJDK builds comparison here and here.
For Java 12 onwards, official General-Availability (GA) and Early-Access (EA) Windows 64-bit builds of the OpenJDK (GPL2 + Classpath Exception) from Oracle are available as tar.gz/zip from the JDK website.
If you prefer an installer, there are several distributions. There is a public Google Doc and Blog post by the Java Champions community which lists the best-supported OpenJDK distributions. Currently, these are:
AdoptOpenJDK has been superseded by Adoptium/Temurin (Hotspot) and IBM Semeru (OpenJ9)
Adoptium Temurin
Amazon Corretto
IBM Semeru (with OpenJ9 JVM)
Liberica from Bellsoft
Microsoft Build of OpenJDK
OpenLogic OpenJDK
Red Hat OpenJDK
SAPMachine (backed by SAP)
Zulu Community (backed by Azul Systems)
https://www.openlogic.com/openjdk-downloads allowed me to pick a 32-bit version of OpenJDK8 (don't ask - Arduino IDE doesn't compile with 11), I think they just wrap around AdoptOpenJDK MSIs but I couldn't find 32-bit distros on AdoptOpenJDK.
In addition to the above answers, it is worth noting that you have to move your JDK Path entry to the top of the Path
Here is the complete answer. first of all you have to install the Chocolatey. to install Chocolatey run powershell as administrator and run the following command
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
after this run open cmd as administrator and run this command
choco install -y openjdk11
it will install the openjdk to the following location
C:\Program Files\Eclipse Adoptium\jdk-11.0.16.101-hotspot
finllay set your JAVA_HOME TO
C:\Program Files\Eclipse Adoptium\jdk-11.0.16.101-hotspot
and cheers
WinGet is now available on Windows 10+ to install the Microsoft Build of OpenJDK on your machine. See details and access the downloads page at https://aka.ms/msopenjdk/ where Zip files and instructions.
Scoop installs programs you know and love, from the command line with a minimal amount of friction.
Install scoop
Add java scoop bucket add java
Install OpenJDK scoop.cmd install openjdk17

Gradle configuration on AndroidStudio 1.0X

I have downloaded a fresh copy of AndroidStudio 1.02 which comes with gradle 2.2.1. My JAVA_HOME points to a java 1.7 installation. In fact I do not even have java 1.4.
Yet I receive this error:
Error:Gradle 2.2.1 requires Java 6 or later to run. Your build is currently configured to use Java 4.
After searching for an hour on the internet and digging into AndroidStudio settings I cannot get it to work. I'll appreciate if someone can help.
Try File->Other Settings->Default Project Structure and set JDK Location to Java 6 or later

Which version of CDH using Cloudera Manager automatically Installs JDK1.7?

I am using Cloudera Manager with CDH4.2.2 for my 3+1 cluster. On starting the installation with cloudera manager, it automatically downloads and installs JDK1.6. I want to use JDK1.7 with CDH for my convinience. Is it possible or is there any version of CDH which while installating Hadoop in the cluster automatically downloads and installs and successfully runs Hadoop with JDK1.7?
If yes, may I know which version of CDH is it and where do i get to download it from?
I want to work with JDK1.7 instead of 1.6 because i want to install Apache Giraph on CDH but it seems Giraph does not fit fine with JDK1.6 and needs the JDK1.7.
With Regards,
JDK 1.7 is supported for all CDH applications as of CDH 4.4 and Cloudera Manager 4.7.
That being said, no version of Cloudera Manager 4.x installs JDK 1.7 during the installation (latest version is 4.8.2). The only version of Cloudera Manager that installs JDK 1.7 automatically is 5.0.0.
To summarize: If you want an automated installation of JDK 1.7 via Cloudera Manager, you need to upgrade to CDH 5, and CM 5.0.0. Alternatively, you could upgrade to CDH4.4, and then perform a manual installation of JDK 1.7.

Is there a way to build JRuby jars for lower Java versions on mac?

I am playing around with JRuby with mac, and have installed 1.7 JDK, and created a jar file to see how it would go on other macs, but since the current Mac's default Java is 1.6, the jars could not be opened.
I tried to install 1.6 JDK, but couldn't find a mac version for it, is it possible to build for Java 1.6, or am I doing something wrong?

Adding JRE 7 to eclipse on mac osx after upgrading to app-engine 1.7.7

I have been developing an app with the GAE-Eclipse-plugin. I just updated eclipse to app-engine 1.7.7. So that launched a whirlwind of errors that I have been walking thru. I finally figured that I need to install jre7. So I went to http://www.macupdate.com/app/mac/44788/java-se-runtime-environment-7 and installed the jre. Then I try to link eclipse to the jre by going thru eclipse > preferences > java > installed JREs. There I only saw Java SE 6. So I clicked on MacOS X VM then browsed to /System/Library/Frameworks/JavaVM.framework/Versions/. When I got there I expected to find 1.7. But instead, after 1.6.0 I see A, Current, CurrentJDK.
Is the correct version missing from the list or which one of those three am I to select otherwise?
You are installing the Java SE Runtime Environment (JRE), which just updates the browser plugin (/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java). You want to install the Java Development Kit (JDK). I always go to Oracle directly, but here's the MacUpdate link.
Once it's installed you should see it under /Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk. Eclipse should see it, but if you want to use it by default you will need to either update your java links in /usr/bin (not recommended) or update your eclipse.ini file (${eclipse.home}/Eclipse.app/Contents/MacOS/eclipse.ini) to point to the new JVM.

Resources