Forum Stats

  • 3,767,982 Users
  • 2,252,736 Discussions
  • 7,874,399 Comments

Discussions

sqlcl ignores JAVA_HOME

Wolfgang Huber
Wolfgang Huber Member Posts: 3 Green Ribbon

Hi!

output of java -version:

openjdk version "1.8.0_292"

OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_292-b10)

OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.292-b10, mixed mode)

output of sqlcl:

This application requires a Java Runtime Environment 1.8.0_22

additionally the jdk-download-page is opened in the browser

sqlcl-version: 21.3.1.281.1748

Any possibility to use sqlcl with a pre-installed jdk?

Answers

  • Mike Kutz
    Mike Kutz Member Posts: 5,789 Silver Crown

    OpenJDK != Oracle JDK

    Is that Vendor's JDK certified to run SQLcl?

  • Wolfgang Huber
    Wolfgang Huber Member Posts: 3 Green Ribbon
    edited Oct 20, 2021 1:32PM
  • Mike Kutz
    Mike Kutz Member Posts: 5,789 Silver Crown

    Usually, it's in the documentation and states "only xxx vendors of Java Y are supported". I don't see vendor specifics listed.

    May need a shout out to @thatJeffSmith-Oracle or his team.


  • thatJeffSmith-Oracle
    thatJeffSmith-Oracle Distinguished Product Manager Posts: 8,056 Employee

    Officially we only support Oracle Java, 8 or 11.

    The OpenJDK distribution's 11 and higher (up until 17) should probably work. But officially, it's the Oracle distribution that's tested and supported.

  • user9540031
    user9540031 Member Posts: 129 Silver Badge

    Hello,

    @Wolfgang Huber

    sqlcl ignores JAVA_HOME

    It most certainly doesn't.

    And it can (very likely) be run with OpenJDK—at the cost of not being officially supported by Oracle, meaning it's not necessarily tested by Oracle development and, should you run into a technical issue, Oracle Support may require you to reproduce it using an officially-supported Oracle-supplied JDK before helping you further.

    From a purely technical viewpoint, however, regressions aside there's nothing that should block you from using OpenJDK—e.g.:

    $ type java
    java is a tracked alias for /products/openjdk/jdk8u312-b07/bin/java
    
    $ java -version
    openjdk version "1.8.0_312"
    OpenJDK Runtime Environment (Temurin)(build 1.8.0_312-b07)
    OpenJDK 64-Bit Server VM (Temurin)(build 25.312-b07, mixed mode)
    
    $ sql /nolog
    
    SQLcl: Release 21.3 Production on Sun Oct 31 01:23:45 2021
    
    Copyright (c) 1982, 2021, Oracle.  All rights reserved.
    
    SQL> show version
    Oracle SQLDeveloper Command-Line (SQLcl) version: 21.3.2.0 build: 21.3.2.287.1503
    SQL> show java
    Java Detail
    -----------
    java.home= /products/openjdk/jdk8u312-b07/jre
    java.vendor= Temurin
    java.vendor.url= https://adoptium.net/
    java.version= 1.8.0_312
    

    Above I had ${JAVA_HOME}/bin in the PATH, but even that is not necessary; only exporting JAVA_HOME is.

    Could the error that you got ("This application requires a Java Runtime Environment 1.8.0_22") have been caused by misconfiguration, or an environment conflict in your setup?

    That said, I fail to see why you would use OpenJDK when Oracle entitles you to use the officially-supported JDK 1.8 along with SQL Developer and SQLcl.

    My two cents...

    Regards,