Illegal refelctive access in SDK

Post here questions and problems related to oXygen frameworks/document types.
sderrick
Posts: 264
Joined: Sat Jul 10, 2010 4:03 pm

Illegal refelctive access in SDK

Post by sderrick »

I see the following warnings when starting our application that uses the SDK

WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by ro.sync.ui.qe (file:/home/scott/Desktop/ide/oxygen-22.0.0.0.jar) to field javax.swing.text.DefaultHighlighter.highlights
WARNING: Please consider reporting this to the maintainers of ro.sync.ui.qe
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

Is this fixed in the latest release?

thanks,

Scott
adrian
Posts: 2850
Joined: Tue May 17, 2005 4:01 pm

Re: Illegal refelctive access in SDK

Post by adrian »

Hello,

The "illegal reflective access operation" warnings appear when running Oxygen with Java 9 and later. Oxygen relies on reflection to set up some hooks and handlers in the Java VM (e.g. URL handlers), so these illegal reflective access operations are currently unavoidable.
So, no, this isn't something that needs fixing at this time. They are just warning messages.
It's possible that future versions of Java will deny these operations by default, but you will most likely still be able to allow them with the Java argument

Code: Select all

--illegal-access=permit
This was discussed here on the forum. Please see Radu's comment here:
post57823.html#p57823

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
sderrick
Posts: 264
Joined: Sat Jul 10, 2010 4:03 pm

Re: Illegal refelctive access in SDK

Post by sderrick »

Adrian,

Normally I start our app with java.exe -jar mbep-editor-2.0.jar

I tried java.exe --illegal-access=permit -jar mbep-editor-2.0.jar

Unrecognized option: --illegal-access=permit
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

thanks,

Scott
adrian
Posts: 2850
Joined: Tue May 17, 2005 4:01 pm

Re: Illegal refelctive access in SDK

Post by adrian »

Hi,

The "--illegal-access=permit" argument is only available for Java 9 and later. It doesn't change anything at this time for Java 9 - 15 since this is the default, so it's unnecessary.

What version of Java is that?
java -version or java --version

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Post Reply