[libbluray-devel] libbluray on Windows 10 with JRE 9

Fridrich Strba fridrich.strba at suse.com
Tue Dec 19 08:36:46 CET 2017


Hello,

On 10/12/17 16:15, epirat07 at gmail.com (Marvin Scholz) wrote:
> Does it need to compile with JDK 9 to run with JRE 9?

For this case, it actually does :(
For instance, the BDFileSystem does not implement one virtual function,
so on runtime, there is a potential problem.
Also, sun.awt.CausedFocusEvent.Cause was removed and replaced by
FocusEvent.Cause which is new in jdk9. So that is another symbol that
will not be resolved on runtime.

I am attaching a patch that allows here building on Linux, but the
resulting library cannot be run any more with jdk < 9, since the
FocusEvent.Cause does not exist in jdk8. Also the patch resolves the
implementing of the missing function of FileSystem by extending
UnixFileSystem. Which is bound to work here on Linux, but a fix for
Windows has to be different.

> It seems it already fails at initializing the JVM, maybe API changed for that?

In src/libbluray/bdj/bdj.c there is:

static const char * const jvm_dir[]  = {"jre/lib/" JAVA_ARCH "/server"};

which is wrong for jdk9 and higher, since it should be "lib/server"
simply. Most likely that is why you cannot initialize the JVM.

But there are some more bad news. When you try to build the whole thing
with jdk10, which is due to be released in March, you get:

[javac]
/home/abuild/rpmbuild/BUILD/libbluray-1.0.2/src/libbluray/bdj/java/org/videolan/BDJSecurityManager.java:81:
error: cannot find symbol
[javac]                 if
(classDepth("javax.crypto.JceSecurityManager") < 3) {
[javac]                     ^
[javac]   symbol:   method classDepth(String)
[javac]   location: class BDJSecurityManager
[javac]
/home/abuild/rpmbuild/BUILD/libbluray-1.0.2/src/libbluray/bdj/java/org/videolan/BDJSecurityManager.java:88:
error: cannot find symbol
[javac]                 if (classDepth("org.videolan.Libbluray") == 3) {
[javac]                     ^
[javac]   symbol:   method classDepth(String)
[javac]   location: class BDJSecurityManager
[javac]
/home/abuild/rpmbuild/BUILD/libbluray-1.0.2/src/libbluray/bdj/java/org/videolan/BDJSecurityManager.java:97:
error: cannot find symbol
[javac]             if (classDepth("sun.awt.AWTAutoShutdown") > 0) {
[javac]                 ^
[javac]   symbol:   method classDepth(String)
[javac]   location: class BDJSecurityManager
[javac]
/home/abuild/rpmbuild/BUILD/libbluray-1.0.2/src/libbluray/bdj/java/org/videolan/BDJSecurityManager.java:222:
warning: [removal] checkSystemClipboardAccess() in SecurityManager has
been deprecated and marked for removal
[javac]     public void checkSystemClipboardAccess() {
[javac]                 ^
[javac] Note: Some input files use or override a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 3 errors
[javac] 7 warnings

This is due to the fact that some of the SecurityManager methods,
deprecated since java 1.2, were finally removed. So, libbluray, as it is
right now, will not work with jdk10 either, if built with whatever lower
version that will allow it to be built. This will need a rethinking of
the BDJSecurityManager.java all together and when one looks at the
deprectation warnings, some other problems are just waiting for their
own time.

Cheers

Fridrich
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libbluray-java9.patch
Type: text/x-patch
Size: 2402 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/libbluray-devel/attachments/20171219/320db498/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: OpenPGP digital signature
URL: <http://mailman.videolan.org/pipermail/libbluray-devel/attachments/20171219/320db498/attachment.sig>


More information about the libbluray-devel mailing list