Java 12 Compatibility

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Java 12 Compatibility

Hamza Mesbahi
Hello,

I've downloaded NiFi 1.9.2. and installed it on my Windows 10 using cmd
window. I currently have Java 12 installed on my computer and executable
from Path.
When I input the following command: "Start run-nifi.bat" I get the usual
gibberish but towards the end 10-15 lines this is what I get: WARNING: An
illegal reflective access operation has occurred
WARNING: Illegal reflective access by
org.apache.nifi.bootstrap.util.OSUtils
(file:/C:/Nifi/nifi-1.9.2/lib/bootstrap/nifi-bootstrap-1.9.2.jar) to method
java.lang.ProcessImpl.pid()
WARNING: Please consider reporting this to the maintainers of
org.apache.nifi.bootstrap.util.OSUtils
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
2019-07-16 15:50:26,289 WARN [main] org.apache.nifi.bootstrap.Command
Failed to set permissions so that only the owner can read pid file
C:\Nifi\NIFI-1~1.2\bin\..\run\nifi.pid; this may allows others to have
access to the key needed to communicate with NiFi. Permissions should be
changed so that only the owner can read this file
2019-07-16 15:50:26,293 WARN [main] org.apache.nifi.bootstrap.Command
Failed to set permissions so that only the owner can read status file
C:\Nifi\NIFI-1~1.2\bin\..\run\nifi.status; this may allows others to have
access to the key needed to communicate with NiFi. Permissions should be
changed so that only the owner can read this file
2019-07-16 15:50:26,321 INFO [main] org.apache.nifi.bootstrap.Command
Launched Apache NiFi with Process ID 2112
I've been doing some research and have found that for a while Nifi wasn't
compatible with Java 11, however now it is. But I have Java 12 installed,
is Nifi 1.9.2 compatible with Java 12 SDK or is that the issue resulting in
that log output?

Thanks,

Hamza
Reply | Threaded
Open this post in threaded view
|

Re: Java 12 Compatibility

Mike Thomsen
I believe those warnings are given with Java 11 as well. Java 12 is not
officially supported, but that's not to say it's incompatible with NiFi
since the delta between it and Java 11 is not that big. I would recommend
avoiding any experimental features bundled with Java 12 and stick to ones
that the OpenJDK team says are stable in Java 12. For production scenarios,
Java 8 or Java 11 would be strongly recommended over Java 12.

On Tue, Jul 16, 2019 at 7:27 PM Hamza Mesbahi <[hidden email]>
wrote:

> Hello,
>
> I've downloaded NiFi 1.9.2. and installed it on my Windows 10 using cmd
> window. I currently have Java 12 installed on my computer and executable
> from Path.
> When I input the following command: "Start run-nifi.bat" I get the usual
> gibberish but towards the end 10-15 lines this is what I get: WARNING: An
> illegal reflective access operation has occurred
> WARNING: Illegal reflective access by
> org.apache.nifi.bootstrap.util.OSUtils
> (file:/C:/Nifi/nifi-1.9.2/lib/bootstrap/nifi-bootstrap-1.9.2.jar) to method
> java.lang.ProcessImpl.pid()
> WARNING: Please consider reporting this to the maintainers of
> org.apache.nifi.bootstrap.util.OSUtils
> 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
> 2019-07-16 15:50:26,289 WARN [main] org.apache.nifi.bootstrap.Command
> Failed to set permissions so that only the owner can read pid file
> C:\Nifi\NIFI-1~1.2\bin\..\run\nifi.pid; this may allows others to have
> access to the key needed to communicate with NiFi. Permissions should be
> changed so that only the owner can read this file
> 2019-07-16 15:50:26,293 WARN [main] org.apache.nifi.bootstrap.Command
> Failed to set permissions so that only the owner can read status file
> C:\Nifi\NIFI-1~1.2\bin\..\run\nifi.status; this may allows others to have
> access to the key needed to communicate with NiFi. Permissions should be
> changed so that only the owner can read this file
> 2019-07-16 15:50:26,321 INFO [main] org.apache.nifi.bootstrap.Command
> Launched Apache NiFi with Process ID 2112
> I've been doing some research and have found that for a while Nifi wasn't
> compatible with Java 11, however now it is. But I have Java 12 installed,
> is Nifi 1.9.2 compatible with Java 12 SDK or is that the issue resulting in
> that log output?
>
> Thanks,
>
> Hamza
>
Reply | Threaded
Open this post in threaded view
|

Re: Java 12 Compatibility

Edward Armes
So the warning here isn't something you need to worry about and you'll find
it's quite a common one, on a lot of Java applications and its down to
changes made in Java 9,

The short reason for this, is that in Java 9 a new type of package was
created a Module. A module is essentially a package of packages. The
important thing to note here is that by default unless it is done
explicitly then a module won't expose it's entire API by default even if a
resource is marked a public, the important part here is that this
restriction also applies to the Java reflection system as well.

In Java 9 the standard Java API seems to have been implemented into modules
and certain things are not exposed in the module definition. Now to get
people onto Java 9+ one of things that was decided was, that by default the
reflect system would allowed access unexposed API in modules  for now.
However it is clear from various bits of documentation that in the future
that this will change, and that specific JVM flags will need to be used to
override the module export definition to expose packages. The intention of
this flag seems to be that it is made clear that you are invoking an
internal module that a developer of the module wasn't intending people to
use, so when it breaks it's not developers fault.

I would note what  I've said above is a very rough explanation and there is
a lot more complexity and subtlety to how this works. At some point in the
future I'm going to do some proper research into this, as I can see it in
the future giving me and others the runaround.

Like I said it's nothing to worry about and it's quite common as you will
see this warning on anything that's using a version of Spring that pre-java
9 and using parts of Spring that use reflection on a Java 9 or newer run
time.

Edward

On Wed, Jul 17, 2019 at 12:39 AM Mike Thomsen <[hidden email]>
wrote:

> I believe those warnings are given with Java 11 as well. Java 12 is not
> officially supported, but that's not to say it's incompatible with NiFi
> since the delta between it and Java 11 is not that big. I would recommend
> avoiding any experimental features bundled with Java 12 and stick to ones
> that the OpenJDK team says are stable in Java 12. For production scenarios,
> Java 8 or Java 11 would be strongly recommended over Java 12.
>
> On Tue, Jul 16, 2019 at 7:27 PM Hamza Mesbahi <[hidden email]>
> wrote:
>
> > Hello,
> >
> > I've downloaded NiFi 1.9.2. and installed it on my Windows 10 using cmd
> > window. I currently have Java 12 installed on my computer and executable
> > from Path.
> > When I input the following command: "Start run-nifi.bat" I get the usual
> > gibberish but towards the end 10-15 lines this is what I get: WARNING: An
> > illegal reflective access operation has occurred
> > WARNING: Illegal reflective access by
> > org.apache.nifi.bootstrap.util.OSUtils
> > (file:/C:/Nifi/nifi-1.9.2/lib/bootstrap/nifi-bootstrap-1.9.2.jar) to
> method
> > java.lang.ProcessImpl.pid()
> > WARNING: Please consider reporting this to the maintainers of
> > org.apache.nifi.bootstrap.util.OSUtils
> > 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
> > 2019-07-16 15:50:26,289 WARN [main] org.apache.nifi.bootstrap.Command
> > Failed to set permissions so that only the owner can read pid file
> > C:\Nifi\NIFI-1~1.2\bin\..\run\nifi.pid; this may allows others to have
> > access to the key needed to communicate with NiFi. Permissions should be
> > changed so that only the owner can read this file
> > 2019-07-16 15:50:26,293 WARN [main] org.apache.nifi.bootstrap.Command
> > Failed to set permissions so that only the owner can read status file
> > C:\Nifi\NIFI-1~1.2\bin\..\run\nifi.status; this may allows others to have
> > access to the key needed to communicate with NiFi. Permissions should be
> > changed so that only the owner can read this file
> > 2019-07-16 15:50:26,321 INFO [main] org.apache.nifi.bootstrap.Command
> > Launched Apache NiFi with Process ID 2112
> > I've been doing some research and have found that for a while Nifi wasn't
> > compatible with Java 11, however now it is. But I have Java 12 installed,
> > is Nifi 1.9.2 compatible with Java 12 SDK or is that the issue resulting
> in
> > that log output?
> >
> > Thanks,
> >
> > Hamza
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: Java 12 Compatibility

Jeff
Hamza,

This particular reflective access issue, as Edward mentioned, isn't
something you need to worry about.  The code that's causing that issue is
from accessing the Java 9+ Process API from code compiled on Java 8, and
was a necessary addition for getting NiFi built on Java 8 to run on Java 9+.

NIFI-5176 [1] is the task driving build compatibility for NiFi on Java 11
and it is very close to being out of draft status.  When building and
running NiFi on Java 11+, you won't see this particular warning.

[1] https://issues.apache.org/jira/browse/NIFI-5176

On Wed, Jul 17, 2019 at 11:08 AM Edward Armes <[hidden email]>
wrote:

> So the warning here isn't something you need to worry about and you'll find
> it's quite a common one, on a lot of Java applications and its down to
> changes made in Java 9,
>
> The short reason for this, is that in Java 9 a new type of package was
> created a Module. A module is essentially a package of packages. The
> important thing to note here is that by default unless it is done
> explicitly then a module won't expose it's entire API by default even if a
> resource is marked a public, the important part here is that this
> restriction also applies to the Java reflection system as well.
>
> In Java 9 the standard Java API seems to have been implemented into modules
> and certain things are not exposed in the module definition. Now to get
> people onto Java 9+ one of things that was decided was, that by default the
> reflect system would allowed access unexposed API in modules  for now.
> However it is clear from various bits of documentation that in the future
> that this will change, and that specific JVM flags will need to be used to
> override the module export definition to expose packages. The intention of
> this flag seems to be that it is made clear that you are invoking an
> internal module that a developer of the module wasn't intending people to
> use, so when it breaks it's not developers fault.
>
> I would note what  I've said above is a very rough explanation and there is
> a lot more complexity and subtlety to how this works. At some point in the
> future I'm going to do some proper research into this, as I can see it in
> the future giving me and others the runaround.
>
> Like I said it's nothing to worry about and it's quite common as you will
> see this warning on anything that's using a version of Spring that pre-java
> 9 and using parts of Spring that use reflection on a Java 9 or newer run
> time.
>
> Edward
>
> On Wed, Jul 17, 2019 at 12:39 AM Mike Thomsen <[hidden email]>
> wrote:
>
> > I believe those warnings are given with Java 11 as well. Java 12 is not
> > officially supported, but that's not to say it's incompatible with NiFi
> > since the delta between it and Java 11 is not that big. I would recommend
> > avoiding any experimental features bundled with Java 12 and stick to ones
> > that the OpenJDK team says are stable in Java 12. For production
> scenarios,
> > Java 8 or Java 11 would be strongly recommended over Java 12.
> >
> > On Tue, Jul 16, 2019 at 7:27 PM Hamza Mesbahi <
> [hidden email]>
> > wrote:
> >
> > > Hello,
> > >
> > > I've downloaded NiFi 1.9.2. and installed it on my Windows 10 using cmd
> > > window. I currently have Java 12 installed on my computer and
> executable
> > > from Path.
> > > When I input the following command: "Start run-nifi.bat" I get the
> usual
> > > gibberish but towards the end 10-15 lines this is what I get: WARNING:
> An
> > > illegal reflective access operation has occurred
> > > WARNING: Illegal reflective access by
> > > org.apache.nifi.bootstrap.util.OSUtils
> > > (file:/C:/Nifi/nifi-1.9.2/lib/bootstrap/nifi-bootstrap-1.9.2.jar) to
> > method
> > > java.lang.ProcessImpl.pid()
> > > WARNING: Please consider reporting this to the maintainers of
> > > org.apache.nifi.bootstrap.util.OSUtils
> > > 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
> > > 2019-07-16 15:50:26,289 WARN [main] org.apache.nifi.bootstrap.Command
> > > Failed to set permissions so that only the owner can read pid file
> > > C:\Nifi\NIFI-1~1.2\bin\..\run\nifi.pid; this may allows others to have
> > > access to the key needed to communicate with NiFi. Permissions should
> be
> > > changed so that only the owner can read this file
> > > 2019-07-16 15:50:26,293 WARN [main] org.apache.nifi.bootstrap.Command
> > > Failed to set permissions so that only the owner can read status file
> > > C:\Nifi\NIFI-1~1.2\bin\..\run\nifi.status; this may allows others to
> have
> > > access to the key needed to communicate with NiFi. Permissions should
> be
> > > changed so that only the owner can read this file
> > > 2019-07-16 15:50:26,321 INFO [main] org.apache.nifi.bootstrap.Command
> > > Launched Apache NiFi with Process ID 2112
> > > I've been doing some research and have found that for a while Nifi
> wasn't
> > > compatible with Java 11, however now it is. But I have Java 12
> installed,
> > > is Nifi 1.9.2 compatible with Java 12 SDK or is that the issue
> resulting
> > in
> > > that log output?
> > >
> > > Thanks,
> > >
> > > Hamza
> > >
> >
>