9 Replies Latest reply on Dec 6, 2019 5:02 PM by Glen Conway

    Problem found when using  Java 10.0.0.1

    user12067909

      WARNING: An illegal reflective access operation has occurred

      WARNING: Illegal reflective access by oracle.dbtools.raptor.utils.WindowsUtility (file:/E:/oracle/product/12.1.0/dbhome_64/sqlcl/li

      /dbtools-common.jar) to method java.util.prefs.WindowsPreferences.WindowsRegOpenKey(int,byte[],int)

      WARNING: Please consider reporting this to the maintainers of oracle.dbtools.raptor.utils.WindowsUtility

      WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations

      WARNING: All illegal access operations will be denied in a future release

       

       

      SQLcl: Release 18.1.1 Production on Thu May 03 09:17:17 2018

        • 1. Re: Problem found when using  Java 10.0.0.1
          thatJeffSmith-Oracle

          Thanks for the heads-up. For the moment, Java 10 is not supported.

          • 2. Re: Problem found when using  Java 10.0.0.1
            user1281727

            Starting SQLDeveloper as User2 from
            C:\sqldeveloper-18.2.0.183.1748-x64\sqldeveloper\sqldeveloper\bin\sqldeveloper64.exe
            where it was installed (copied) by another user: User1

             

            WARNING: An illegal reflective access operation has occurred
            WARNING: Illegal reflective access by oracle.dbtools.raptor.utils.WindowsUtility
            (file:/C:/sqldeveloper-18.2.0.183.1748-x64/sqldeveloper/sqldeveloper/lib/dbtool
            s-common.jar) to method java.util.prefs.WindowsPreferences.WindowsRegOpenKey(int
            ,byte[],int)
            WARNING: Please consider reporting this to the maintainers of oracle.dbtools.rap
            tor.utils.WindowsUtility
            WARNING: Use --illegal-access=warn to enable warnings of further illegal reflect
            ive access operations
            WARNING: All illegal access operations will be denied in a future release

             

            this is an SQLDeveloper with JDK9 included. Is it intended to install it per user?

            • 3. Re: Problem found when using  Java 10.0.0.1
              Glen Conway

              Each user accessing a single install of SQL Developer on a machine will still have their own user settings under

              C:\Users\<userID>\AppData\Roaming

              which includes both

              C:\Users\<userID>\AppData\Roaming\SQL Developer\system18.2.0.183.1748\...

              and

              C:\Users\<userID>\AppData\Roaming\sqldeveloper\18.2.0\product.conf

              Probably what happened in your case is that User1 has the SetJavaHome line in product.conf commented out so that the bundled Java 9 is used, while User2 (possibly from experimenting with an 18.2 install in another location) has that SetJavaHome line pointing at Java 10 which, as the release notes explain, is not supported.  Here is a sample product.conf file snippet with SetJavaHome variations:

              #SetJavaHome C:\Program Files\Java\jdk1.8.0_181

              #SetJavaHome C:\Program Files\Java\jdk-9.0.4

              #SetJavaHome C:\Program Files\Java\jdk-10.0.1  

              Only if any/all SetJavaHome lines are commented out, then the bundled Java 9 will be used.  Otherwise you are in complete control by setting SetJavaHome as desired in product.conf.

               

              Cheers

              • 4. Re: Problem found when using  Java 10.0.0.1
                AndyH

                Hi,

                 

                I've came across the same problem with SQLcl 19.1.

                 

                Do you know if there are plans to support Java 10?

                 

                Should I be worried about the warning?

                 

                Thanks,

                 

                --

                Andy

                • 5. Re: Problem found when using  Java 10.0.0.1
                  AndyH

                  Actually, I seem to get the warning messages when running against a JRE 1.8?

                   

                  C:\Users\awha\Downloads\sqlcl-19.1.0.094.1619\sqlcl\bin>

                  C:\Users\awha\Downloads\sqlcl-19.1.0.094.1619\sqlcl\bin>echo %path%

                  C:\Users\awha\Downloads\sqlcl-19.1.0.094.1619\jre\bin

                   

                  C:\Users\awha\Downloads\sqlcl-19.1.0.094.1619\sqlcl\bin>echo %java_home%

                  C:\Users\awha\Downloads\sqlcl-19.1.0.094.1619\jre

                   

                  C:\Users\awha\Downloads\sqlcl-19.1.0.094.1619\sqlcl\bin>java -version

                  java version "1.8.0_171"

                  Java(TM) SE Runtime Environment (build 1.8.0_171-b11)

                  Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)

                   

                   

                  C:\Users\awha\Downloads\sqlcl-19.1.0.094.1619\sqlcl\bin>sql

                   

                  SQLcl: Release 19.1 Production on Thu Apr 25 10:45:54 2019

                  Copyright (c) 1982, 2019, Oracle.  All rights reserved.

                  WARNING: An illegal reflective access operation has occurred

                  WARNING: Illegal reflective access by oracle.dbtools.raptor.utils.WindowsUtility (file:/C:/Users/awha/Downloads/sqlcl-19.1.0.094.1619/sqlcl/lib/dbtools-common.jar) to method java.util.prefs.WindowsPreferences.WindowsRegOpenKey(int,byte[],int)

                  WARNING: Please consider reporting this to the maintainers of oracle.dbtools.raptor.utils.WindowsUtility

                  WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations

                   

                  Or... maybe the sql.exe in 19.1 ignores path statements, etc. to hunt down my JDK 10?

                  • 6. Re: Problem found when using  Java 10.0.0.1
                    Glen Conway

                    Or... maybe the sql.exe in 19.1 ignores path statements, etc. to hunt down my JDK 10?

                    Yes, SQL Developer uses Launch4J (https://sourceforge.net/projects/launch4j/ ) to create its EXE, and one of the services Launch4J offers, if a JRE is not bundled in, is to

                    "[search] for newest Sun or IBM JRE / JDK in given version range and type (64-bit or 32-bit)".

                     

                    But since Java 9 and higher are not yet supported (see the SQLcl 19.1 Release Notes https://www.oracle.com/technetwork/developer-tools/sqlcl/downloads/sqlcl-relnotes-191-5459136.html )

                    that means SQLcl on Windows will find an unsupported JRE / JDK if you have installed anything beyond Java 8.  This behavior on Windows helps if you have other, older applications using Java releases prior to Java 8,

                    but forces you to de-install more modern releases if you want to run SQLcl 17.4 or higher (the 17.3 release or lower included a sql.bat file that respected environment variables).  The 17.4 release was also the last one to allow you to force the use a specific JRE by adding a jre directory under the sqlcl directory.

                     

                    On Linux, the situation is a bit different since there is no EXE and the sql script is editable.  The only thing to be aware of there is how ORACLE_HOME affects behavior as discussed in  replies 5 through 10 of Re: sqlcl java errors under different db homes

                     

                    Hope this helps

                    • 7. Re: Problem found when using  Java 10.0.0.1
                      AndyH

                      Ah... the Launch4J detail clarifies things. If I do startup sqlcl and 'show java' it points to my JDK 10.

                       

                      Maybe I'll see whether I can find a SQLcl 17 installation where I can setup the environment in the bat file... but I think that I'll probably just wait until SQLcl supports current versions of Java.

                       

                      Thanks for your help.

                       

                      --

                      Andy

                      • 8. Re: Problem found when using  Java 10.0.0.1
                        Tim St. H.

                        Excellent.

                         

                        Using SQLcl 19.1 on Windows 10

                         

                        Received error on each launch of SQLcl

                         

                        java.lang.NoSuchMethodException: java.util.prefs.WindowsPreferences.WindowsRegOpenKey(int,[B,int)

                                at java.base/java.lang.Class.getDeclaredMethod(Class.java:2480)

                        -- snip --

                         

                        Removed Java installations > 1.8.x   (in my case 12)

                        Error no longer seen on launch.

                         

                        Thank you.

                        • 9. Re: Problem found when using  Java 10.0.0.1
                          Glen Conway

                          A correction to a statement in my prior post:

                          The 17.4 release was also the last one to allow you to force the use a specific JRE by adding a jre directory under the sqlcl directory.

                          That is technically a true statement, but only because the rule used by sql.exe to search for bundled JRE changed between 17.4 and 18.1.  See the following: Re: unable to launch SQLCL 18.1