Forum Stats

  • 3,734,715 Users
  • 2,247,030 Discussions
  • 7,857,465 Comments

Discussions

Problem found when using Java 10.0.0.1

user12067909
user12067909 Member Posts: 18
edited Dec 6, 2019 12:02PM in SQLcl

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

Tim St. H.

Answers

  • thatJeffSmith-Oracle
    thatJeffSmith-Oracle Distinguished Product Manager Posts: 7,701 Employee
    edited May 3, 2018 11:19AM

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

  • user1281727
    user1281727 Member Posts: 1
    edited Aug 31, 2018 8:31AM

    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?

  • Glen Conway
    Glen Conway Member Posts: 859 Gold Badge
    edited Aug 31, 2018 11:30AM

    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

  • alanj
    alanj Member Posts: 1
    edited Sep 7, 2018 5:41AM
  • AndyH
    AndyH Member Posts: 648 Bronze Trophy
    edited Apr 25, 2019 5:10AM

    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

  • AndyH
    AndyH Member Posts: 648 Bronze Trophy
    edited Apr 25, 2019 5:55AM

    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\binC:\Users\awha\Downloads\sqlcl-19.1.0.094.1619\sqlcl\bin>echo %java_home%C:\Users\awha\Downloads\sqlcl-19.1.0.094.1619\jreC:\Users\awha\Downloads\sqlcl-19.1.0.094.1619\sqlcl\bin>java -versionjava 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>sqlSQLcl: Release 19.1 Production on Thu Apr 25 10:45:54 2019Copyright (c) 1982, 2019, Oracle.  All rights reserved.WARNING: An illegal reflective access operation has occurredWARNING: 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.WindowsUtilityWARNING: 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?

  • Glen Conway
    Glen Conway Member Posts: 859 Gold Badge
    edited Apr 26, 2019 4:07AM
    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

    Hope this helps

    Tim St. H.
  • AndyH
    AndyH Member Posts: 648 Bronze Trophy
    edited Apr 26, 2019 4:55AM

    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

  • Tim St. H.
    Tim St. H. Member Posts: 99 Red Ribbon
    edited Jul 25, 2019 2:00PM

    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.

  • Glen Conway
    Glen Conway Member Posts: 859 Gold Badge
    edited Dec 6, 2019 12:02PM

    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:  

Sign In or Register to comment.