8 Replies Latest reply on Mar 4, 2020 9:40 AM by 2805484

    Java limitation:lower versions of SQLCL available?

    kirilb_123

      Hi I have a the problem, that we have an older java version installed and cannot switch to newer one. So is there a older SQLCL version available, which will be working also with older Java?

        • 1. Re: Java limitation:lower versions of SQLCL available?
          Gary Graham-Oracle

          While not recommended for the purpose you are asking about, the option to download previous versions is provided by going to this space's download page, then chaining back to the desired prior version via a "Previous Version" hyperlink as show in...

          PreviousVersionDownloads.jpg

          Note that "Troubleshooting" and "Previous Version" are two distinct hyperlinks.

           

          A much better option is to understand how to control which Java version SQLcl actually uses, as discussed in sqlcl java errors under different db homes and summarized below...

          This is a more complete desription of how it actually works...

           

          1. If a JRE is copied into a sqlcl\jre folder, then SQLcl uses that Java version.

          2. Otherwise, running sql.bat uses an explicitly set JAVA_HOME, followed by the Java version appearing first in PATH.

          3. Otherwise, running sql.exe first checks the Windows Registry for which Java version to use, then falls through to the rules in (2).

           

          And, as previously noted, the Java version must be at least 1.7 to avoid an Unsupported major.minor version error.

           

          On Linux (see the sqlcl/bin/sql script), the rules are a bit different...

          1. If a JRE is copied into a sqlcl/jre folder, then SQLcl uses that Java version.

          2. Otherwise it uses the Java version specified in JAVA_HOME.

          3. Otherwise it uses the Java version from the current ORACLE_HOME

          4. Otherwise it uses the Java version appearing first in PATH.

          1 person found this helpful
          • 2. Re: Java limitation:lower versions of SQLCL available?
            59528af4-13ff-4a0a-af55-25894f88dc8b

            The troubleshooting/previous versions link is no longer visible. Is there any way to get an older version of sqlcl ? One of the fixes on your community site suggesting downgrading 1 library to the 17.x version to avoid a bug, and I cannot find this file as the entire 17.x version of sqlcl cannot be downloaded

            • 3. Re: Java limitation:lower versions of SQLCL available?
              Glen Conway

              The troubleshooting/previous versions link is no longer visible.

              Did you go to the download tab ( Oracle SQL Developer Downloads ) and scroll toward the bottom of page?  I can see two links, one for Troubleshooting and one for Previous Version.  If I click on a series of Previous Version links I can chain all the way back to the 4.1.0 version of SQL Developer and get the standalone Early Adopter SQLcl available there: 

              InkedCapture_LI.jpg

              Hope this helps,

              Glen

              • 4. Re: Java limitation:lower versions of SQLCL available?
                Glen Conway

                Just cross-posting a correction to the rule posted by @GaryGraham-Oracle above:

                1. If a JRE is copied into a sqlcl\jre folder, then SQLcl uses that Java version.

                That isa true statement for SQLcl 17.4 and below, but it changed for 18.1 and above.  See the following: Re: unable to launch SQLCL 18.1 

                • 5. Re: Java limitation:lower versions of SQLCL available?
                  Serg C

                  Had exactly the same issue - a corporate laptop ...

                  Solution that worked for me:

                  1/ download recent SQL Developer WITH java built-in

                  2/ install SQL Developer

                  3/ control panel > java > java tab > view > find/add java located in "sqldeveloper\jdk\jre\bin", un-check Enabled for the newly added > Ok

                  4/ install SQLcl recent version (better on par with SQL Developer)

                  5/ configure JAVA_HOME pointed to "sqldeveloper\jdk\jre\bin" installation

                  6/ done

                  • 6. Re: Java limitation:lower versions of SQLCL available?
                    Glen Conway

                    And for those who don't wish to click on the link in my prior post to that other discussion, here is the relevant information:

                    SQLcl (sql.exe) is checking for a bundled JRE at ..\..\jdk\jre relative to the location of sql.exe.  That is how sqldeveloper.exe has (always?) worked, and is how sql.exe now works as of the 18.1 & up releases. Back in the 17.4 and lower releases, though, it looked in ..\jre.

                    As a corollary, if you use the sql.exe bundled with a SQL Developer 18.1 or higher download that also includes a bundled JRE, then you are all set, nothing more to do, SQLcl will run with the bundled JRE.  Alternatively, using a standalone SQLcl, you may copy the desired JRE at ..\..\jdk\jre relative to the standalone sql.exe.

                     

                    Cheers

                    • 7. Re: Java limitation:lower versions of SQLCL available?
                      Serg C

                      Indeed. I did not click.

                      Thanks

                      • 8. Re: Java limitation:lower versions of SQLCL available?
                        2805484

                        I am always struggleing with this too.. I have so many jre on my linux and none of it works. I don't know..