Eclipse – Change IDE’s JRE Version

Background

Really fumbling a lot here.

Trying to get the Hibernate Plugin to play well with Eclipse is becoming my fool’s errand.

Wifey

I did not know she had texted.  But, now I know as she is calling.

I could not reach for the phone in time.

But the text read, “When are you getting off work?“.

She is easy.

Her request is always around food.

This time it is pickup seafood. And, don’t forget they close at 9:30 pm.

 

Error Message

As I muddled my way around the Hibernate Wizards confronted with a fresh message.

It read :-

Image

window.hibernateConfigurations.01.20190506.0426PM

Textual

Project ‘helloDBHibernate03’ has higher compiler option than running EclipseHibernate plugins unable to load its classes.
Please decrease the compiler option or run the Eclipse with higher JDK level.

Explanation

I really like mouthful paragraphs that are easy to read and comprehend :-

  1. The error message states my current project’s compiler option is higher than Eclipse’s own JVM.
  2. As a result the Hibernate plugin can not be loaded
  3. To re-mediate
    • Change the project’s compiler option
    • Run Eclipse’s JDK Level

Lineage

I know that the issue is my changing my project’s JDK level.

That move is documented here :-

Eclipse – Changing Targeted JRE
Link

Remediation

I could revert the Project’s JDK level.

or try running Eclipse at a complementary JRE.

GUI

Wanted to do make the transition using the GUI.

But, could not find a way to do so.

Manual

Outline

  1. Ensure you have downloaded and installed the targeted JDK
  2. Configure Eclipse to use targeted JDK
    • Change needs to occur via eclipse.ini

Java Runtime

Java Runtime – v11

Artifact

JRE 11 is available here

artifact.jdk11.20190507.0933AM

Install

Installed JDK 11.

Review Install

The install is targeted at :-

java.install.folder.20190507.0936AM

Review Folder

Noticed :-

  1. Unlike earlier versions :-
    • Bundling
      • We do not have separate installs for JRE and JDK
      • We only have one JDK
    • Naming
      • Folder ( JDK versus JRE )
        • Previous ( < JDK 10 )
          • jre*
        •  New ( >= JDK 10 )
          • jdk*
      • Folder ( Decimal versus Whole)
        • Previous ( < JDK 10 )
          • 1.3
          • 1.8
        •  New ( >= JDK 10 )
          • 10
          • 11

Eclipse

Configuration File

Folder

Please access the eclipse folder

eclipse.winOS.folder.01.20190507.0930AM
eclipse.ini
Outline
  1. Backup eclipse.ini
  2. Modify the following entries
    • vm
      • original
        • -vm
          C:/Program Files/Java/jre1.8.0_181/bin
      • Revised
        • -vm
          C:/Program Files/Java/jdk-11.0.3/bin
    • vmargs
      • original
        • -Dosgi.requiredJavaVersion=1.8
      • revised
        • -Dosgi.requiredJavaVersion=11
    • add-modules
      • original
        • –add-modules=ALL-SYSTEM
          -Dosgi.requiredJavaVersion=1.8
      • revised
        • –add-modules=ALL-SYSTEM
          -Dosgi.requiredJavaVersion=11
Backup File

Please backup the eclipse.ini file.

It is the one we will be modifying.

File – Original

eclipse.revised.1.8.20190507.0953AM

File – Revised

eclipse.revised.11.20190507.0950AM

Validation

Outline

  1. Please restart Eclipse
  2. Use menu to access Eclipse About
    • The “Eclipse About” window appears
    • Please click the “Installation Details” button
    • Please access the “Configuration” Tab
    • The retrieving system Information message appears
    • Waited a few more for the Configuration details to appear

Configuration

v11

Image

jre.version.v11.20190507.1105AM

Text

-vm
C:/Program Files/Java/jdk-11.0.3/bin\server\jvm.dll

 

Dedicated

Life is good once you run into Amy :-

Amy DeGregorio
Baeldung
How to Fix java.lang.UnsupportedClassVersionError
Link

R – Error: package or namespace load failed for “rJava”

Background

Users opens up a ticket regarding issues running an R Script on a new machine.

Error Message

Image

errorloadingpackage.rjava.20190109.0251pm

Textual


Error: package or namespace load failed for "rJava":
 .onLoad failed in loadNamespace() for 'rJava', details:
  call: fun(libname, pkgname)
  error: No CurrentVersion entry in Software/JavaSoft registry!
  Try re-installing Java and make sure R and Java have matching architectures.

Explanation

Unable to load rJava module.

Troubleshooting

java

Is java Installed?

Outline

  1. OS Platform
    • OS :- Windows
      • GUI
        • Control Panel
      • Console
        • java.exe

OS Platform

MS Windows
GUI – Control Panel

Accessed Control Panel, but no Java Applet.controlpanel.20190109.0355pm

Console – java.exe

Syntax


java -version

Syntax – Check specifically for 64-bit


java -d64 -version

Output

Image

java.-d64.20190109.0407pm

Textual


>java -d64 -version
Unrecognized option: -d64
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

 

Remediation

java

Download Java Runtime Environment ( JRE)

Download 64-bit Java JRE from here :-

Java SE Runtime Environment 8 Downloads
Link

java.artifact.20190109.0412pm

Install Java

Install the download artifacts

Validate Java

Validate Java ( x64 )

Syntax

java -d64 -version

Output
Output – Before – Image

java.-d64.DoesNotSupportA64bitJVM.20190109.0419PM.PNG

Output – Before – Textual

Error : This Java instance does not support a 64-bit JVM.
Please install the desired version.

Output – After

java.-d64.Supports64bitJVM.20190109.0420PM.PNG

 

R

Access System

In R, issue call to system.

The call is to validate that the R Script can access the system and invoke the java executable.

System calls

System Call – java
Syntax

system('java -version")

Output
system.java.-version.20190109.0424pm

 

 

 

 

 

SQL Server – v2017 – Install – “Oracle JRE 7 Update 51 (64-bit) is required for Polybase”

Background

Installing SQL Server v2017 and ran into an error that I have seen before.

Error

Error Image

OracleJRE7Update51_x64.2018109.1111AM.PNG

Error Textual

Oracle JRE 7 Update 51 (64-bit) or higher is required for Polybase

Tackled Before

History

Already tackled before here:

SQL Server (v2016) – Installation – Blocked – “Oracle JRE 7 Update 51 (64-bit) or higher is required for Polybase”
here

History

The fix applied was to install Java JRE downloaded from here:

https://www.oracle.com/technetwork/java/javase/downloads/index.html
Link

But, unfortunately even though install applied no help this time.

Trouble Shooting

Let us dig a bit deeper.

SysInternals

Process Monitor

Image

sysInternals.processMonitor.20181009.1010AM.PNG

Explanation

  1. Identified component used by SQL Server Setup
    • Component is ScenarioEngine
  2. ScenarioEngine
    • Log
      • C:\Program Files\Microsoft SQL Server\140\Setup Bootstrap\Log\20181009_092126\Detail.txt

Tail

Tail For Win32

Download

Downloaded Tail For Win32 from here:

Tail for Win32
Link

Usage

Launched “Tail For Win32” and loaded the identified SQL Server Log file ( Detail.txt )

Results
Image
TailforWin32_Usage_20181009_1151AM
Textual

13) 2018-10-09 10:13:06 Slp: Init rule target object: Microsoft.SqlServer.Configuration.Polybase.Polybase_IsMinJavaVersionInstalledFacet
(13) 2018-10-09 10:13:06 SQLPolyBase: Could not find registry setting HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\CurrentVersion.
(13) 2018-10-09 10:13:06 SQLPolyBase: Minimum version expected: 1.7.51. Java not found.
(13) 2018-10-09 10:13:06 SQLPolyBase: Rule 'Polybase_IsMinJavaVersionInstalled' detection result: IsMinJavaVersionInstalled= False
(13) 2018-10-09 10:13:06 Slp: Evaluating rule        : Polybase_IsMinJavaVersionInstalled
(13) 2018-10-09 10:13:06 Slp: Rule running on machine:
(13) 2018-10-09 10:13:06 Slp: Rule evaluation done   : Failed
(13) 2018-10-09 10:13:06 Slp: Rule evaluation message: This computer does not have the Oracle Java SE Runtime Environment Version 7 Update 51 (64-bit) or higher installed. The Oracle Java SE Runtime Environment is software provided by a third party. Microsoft grants you no rights for such third-party software. You are responsible for and must separately locate, read and accept applicable third-party license terms. To continue, download the Oracle SE Java Runtime Environment from https://go.microsoft.com/fwlink/?LinkId=526030.
(13) 2018-10-09 10:13:06 Slp: Send result to channel : RulesEngineNotificationChannel

Textual
  1. QLPolyBase: Could not find registry setting HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\CurrentVersion.
    (13) 2018-10-09 10:13:06 SQLPolyBase: Minimum version expected: 1.7.51. Java not found.

Registry

regedit

Images

Regedit – Image – Before
Image

registry_20181009_1038AM.PNG

Textual
  1. Computer\HKEY_LOCAL_MACHINE\Software\JavaSoft
    • Java Plug-in
    • Java Update
    • Java Web Start
    • Java Web Start Caps
    • JRE
Explanation
  1. HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\CurrentVersion.
    • Java Runtime Environment
      • Missing

Remediation

Outline

Please download Java JRE 8 and install it.

Download

Please download artifacts from here :-

Java SE Runtime Environment 8 Downloads
https://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html
Link

Artifacts

Image

Java SE Runtime Environment 8u181

download_JavaSERuntimeEnvironment_20181009.1221PM.PNG

download_20181009.1026AM.PNG
Explanation
  1. Chose to download Windows X64

 

Install

Images

Destination Folder

download_DestinationFolder_20181009.1031AM.PNG

Installing
Installing -01

install_20181009.1032AM.PNG

java Setup – Complete

install_JavaSetupComplete_20181009.1033AM.PNG

Change in License Terms

download_JavaSERuntimeEnvironment_Roadmap_20181009.1030AM.PNG

Registry

Using regedit, please review the Java’s registry structure.

regedit

Images
Regedit – Image – After
Image

registry_java_jre_1Dot8_20181009_1243PM.PNG

Explanation
  1. HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\CurrentVersion is now present

 

Summary

It appears that Oracle has changed the folder structure for Java in the Windows Registry.

Specifically what used to be

HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\CurrentVersion.

is now

HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\JRE\CurrentVersion.

Please be sure to have Java JRE v1.8 ( Java 8) installed for SQL Server v2016\v2017 Polybase.

Apache – jMeter – Preparation – Java JRE

Background

Pardon the pun, but measuring out jMeter appropriateness for a task we have at hand.

Error

image

NotAbleToFindJavaExecutableOrVersion_20171023_0536PM

 

textual

jmeter
Not able to find Java executable or version. Please check your Java installation.
errorlevel=2
Press any key to continue . . .

 

Troubleshooting

Validation

JRE

Outline

Let us see if we have JRE installed, and if so what version.

 

Steps

  1. Launch MS Windows Control Panel
  2. If Java Applet is not present, then we do not have Java installed, and we can skip the rest of our validation steps
  3. If Java Applet is present, access the Java Applet
  4. The “Java Control Panel” window appears
  5. Access the Java Tab
  6. Click the View button
  7. The “Java Runtime Environment Settings” window appears
    • There are two tabs, User and System
      • User Tab
        • In our User tab, we noticed that we have JRE 1.7 installed
        • We also noticed that its path indicates an install path of “C:\Program Files (x86)\Java\jre7\bin\javaw.exe”
        • Having it in x86 is ominous for us, as our OS in 64-bit

 

Image

javaRuntimeEnvironmentSettings_20171023_0539PM

 

Remediation

Download and install 64-bit Java JRE if your OS is 64-bit

 

Validation

Image

javaRuntimeEnvironmentSettings_20171023_0548PM

 

Tabulated

  1. We have two versions of JRE
    • v1.8
      • Path :- C:\Program Files\java\jre1.8.0_131\bin\javaw.exe
      • Architecture :- x86_64
    • v1.7
      • C:\Program Files (x86) \ Java\jre7\bin\javaw.exe
      • Architecture :- x86

 

Explanation

It looks like we can rumble with x86_64.

 

Success

Ran jmeter.bat again and we are good!

jmeter_20171024_0903AM

SQL Server (v2016) – Installation – Blocked – “Oracle JRE 7 Update 51 (64-bit) or higher is required for Polybase”

Background

In the process of installing “SQL Server 2016” for a new client.

As it is a new client and not really sure exact features they will be using, chose to install “All features“.

Install Blocked

Installation is blocked with the error pasted below:

ScreenShot

Feature Rules

Image

Text

Oracle JRE 7 Update 51 (64-bit) or higher is required for Polybase.

Rule Check Result

Image

Text

This computer does not have the Oracle Java SE Runtime Environment Version 7 Update 51 (64-bit) or higher installed.  The Oracle Java SE runtime environment is software provided by a third-party software.

To continue, download the Oracle SE Java Runtime Environment from http://go.microsoft.com/fwlink/?LinkId=526030.

 

 

Remediation

Visited Microsoft URL

Visited the listed Microsoft page and directed right away to Oracle’s Java download page.

 

Java Standard Edition Downloads

Here are the downloads available for java Standard Edition ( Java SE)

 

Explanation

  1. JDK
    • We know we need JRE ( Java Runtime Engine), and not JDK ( Java Development Kit )
  2. Server JRE
    • Thought we could get away with the the lighter footprint Server JRE
  3. JRE
    • JRE

 

Server JRE

Server JRE – Downloads

Here is the link to the current version ( 10 ).

 

Chose Windows x64.

Install Package Contents

The installer is bundled as a tar.gz.

Using 7-Zip extracted the file, but no installer.

Just app executable and class files.

Need more than that to install JRE and have SQL recognize that Java JRE is installed.

 

JRE

Java SE Runtime Environment 8 Downloads

Needed an executable offline installer and our bitness is 64 bit and so chose jre-8u131-windows-x64.exe.

 

Install

Actual Installation is straightforward.

ScreenShot

Welcome

 

Destination Folder

Create destination Folder beforehand.

Here is a sample script.


@echo off
rem _folder=C:\Program Files\java\jre1.8.0_131
set "_folder=E:\ProgramFiles\Java\JRE1.8.0_131"

if not exist %_folder% mkdir %_folder%

 

 

 

Destination Folder ( Changed )

 

Java Setup – Progress

 

Java Setup – Complete

Summary

If you will be evaluating \ using Polybase as part of SQL Server v2016, please download and install Oracle JRE ( Java Runtime engine) beforehand.

For JRE, there are two packages available for download.  One is marked Server and the generic one.

Please choose the generic, full version.