An illegal reflective access operation has occurred
Hi.
I am trying BaseX version 8.6.7 with java version “9.0.1” on a macOS Sierra, planning to show it in classroom. When running the GUI I am getting the following error:
WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by org.basex.gui.GUIMacOSX (file:/Applications/basex/basex/BaseX.jar) to method com.apple.eawt.Application.getApplication() WARNING: Please consider reporting this to the maintainers of org.basex.gui.GUIMacOSX 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 Failed to initialize native Mac OS X interface
Thanks for help.
Massimo
Hi Massimo,
It seems Mac OSX support is getting more and more difficult with each Java release. Could you still run BaseX in spite of the returned warnings?
Best, Christian
Quoted text · Massimo Franceschet · 22 lines
On Tue, Nov 28, 2017 at 7:52 AM, Massimo Franceschet <massimo.franceschet at gmail.com> wrote: > Hi. > > I am trying BaseX version 8.6.7 with java version “9.0.1” on a macOS Sierra, > planning to show it in classroom. When running the GUI I am getting the > following error: > > WARNING: An illegal reflective access operation has occurred > WARNING: Illegal reflective access by org.basex.gui.GUIMacOSX > (file:/Applications/basex/basex/BaseX.jar) to method > com.apple.eawt.Application.getApplication() > WARNING: Please consider reporting this to the maintainers of > org.basex.gui.GUIMacOSX > 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 > Failed to initialize native Mac OS X interface > > Thanks for help. > > Massimo
No, it is not running.
Best,
Massimo
Il 28 Nov 2017 17:18, "Christian Grün" <christian.gruen at gmail.com> ha scritto:
Quoted text · Christian Grün · 35 lines
> Hi Massimo, > > It seems Mac OSX support is getting more and more difficult with each > Java release. > Could you still run BaseX in spite of the returned warnings? > > Best, > Christian > > > > On Tue, Nov 28, 2017 at 7:52 AM, Massimo Franceschet > <massimo.franceschet at gmail.com> wrote: > > Hi. > > > > I am trying BaseX version 8.6.7 with java version “9.0.1” on a macOS > Sierra, > > planning to show it in classroom. When running the GUI I am getting the > > following error: > > > > WARNING: An illegal reflective access operation has occurred > > WARNING: Illegal reflective access by org.basex.gui.GUIMacOSX > > (file:/Applications/basex/basex/BaseX.jar) to method > > com.apple.eawt.Application.getApplication() > > WARNING: Please consider reporting this to the maintainers of > > org.basex.gui.GUIMacOSX > > 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 > > Failed to initialize native Mac OS X interface > > > > Thanks for help. > > > > Massimo >
Hi Massimo, Seems to be a common problem running with Java 9. This link [1] suggests some command line work arounds (untested by me)
/Andy
[1] https://blog.codefx.org/java/java-9-migration-guide/#Illegal-Access-To-Internal-APIs
Quoted text · Massimo Franceschet · 48 lines
On 29 November 2017 at 11:25, Massimo Franceschet < massimo.franceschet at gmail.com> wrote: > No, it is not running. > > Best, > > Massimo > > Il 28 Nov 2017 17:18, "Christian Grün" <christian.gruen at gmail.com> ha > scritto: > >> Hi Massimo, >> >> It seems Mac OSX support is getting more and more difficult with each >> Java release. >> Could you still run BaseX in spite of the returned warnings? >> >> Best, >> Christian >> >> >> >> On Tue, Nov 28, 2017 at 7:52 AM, Massimo Franceschet >> <massimo.franceschet at gmail.com> wrote: >> > Hi. >> > >> > I am trying BaseX version 8.6.7 with java version “9.0.1” on a macOS >> Sierra, >> > planning to show it in classroom. When running the GUI I am getting the >> > following error: >> > >> > WARNING: An illegal reflective access operation has occurred >> > WARNING: Illegal reflective access by org.basex.gui.GUIMacOSX >> > (file:/Applications/basex/basex/BaseX.jar) to method >> > com.apple.eawt.Application.getApplication() >> > WARNING: Please consider reporting this to the maintainers of >> > org.basex.gui.GUIMacOSX >> > 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 >> > Failed to initialize native Mac OS X interface >> > >> > Thanks for help. >> > >> > Massimo >> >
Quoted text · Massimo Franceschet · 1 line
> No, it is not running.
I’ve uploaded a new snapshot that ignores Mac OSX initialization failures; could you give it a try [1,2]?
I’ve found various user reports that point to the same problem in other applications. Apparently, reflective access to the Apple UI API is now illegal in Java 9 – “The APIs in the com.apple.eawt and com.apple.eio packages are encapsulated, so you won’t be able to compile against them in JDK 9” [3] – so Mac users with Java 9 will need to live with the standard Swing components until BaseX will eventually be upgraded to Java 9.
Right now, I recommend everyone to work with Java 8 anyway until the new JVM has further stabilized (there have been other platform-independent issues with Java 9 that have been reported to us in the recent past).
Best, Christian
[1] http://files.basex.org/releases/latest/ [2] https://github.com/BaseXdb/basex/commit/c02581c8ed4929ec8f4113eff53cc0ba8132045e [3] https://docs.oracle.com/javase/9/migrate/toc.htm#JSMIG-GUID-CACA0F19-2AFA-4214-BBEA-DC4D07702B2D
Written for BaseX 8.6. BaseX may have changed since: please check the current documentation.