Java Runtime Environment in the App Store


#1

Hi. Is it possible to add Java Runtime Environment to OSMC’s App Store? For the purpose of activating the Bluray menu for BD-ISO or BDMV. So it won’t be so hard to install for us who don’t know between a USB cable and an HDMI cable? :grin:

Or is it a legal issue with Oracle?


#2

This was asked a couple of days ago. There are a few issues:

  • Licensing
  • Size: it’s bigger than OSMC. So it would need to be optional. But libbluray and Kodi need to be built with Java at build time; so you can’t make it optional presently and dlopen() these libs on the fly

Further:

With BD-J you’re likely going to be playing an encrypted disc. This is supported, if you install libaacs and ‘acquire’ AACS keys for the title you are going to play.

So quite niche at the moment, but we will continue to monitor things. I’m happy to include this as an option; but don’t want to make it a core part of OSMC at this time

Sam


#3

It far more likely that someone would want to play an un-encrypted ISO backup. The only reason I have a Blu-Ray player is that it’s a pain to find the extras on a lot of discs without using the original menu, and there is no free software player that correctly supports BD-J, but supposedly Leia will (if built correctly, as you said).


#4

Isn’t JRE free for non-personal usage?
Then you haven’t solved the other issues … but the licensing issue should then be resolved.
https://www.oracle.com/technetwork/java/javase/documentation/eol-135779.html


#5

Problem is not the personal usage but the distribution via App Store


#6

That might be OK, too, because the App Store is really just a GUI front end for apt-get. The problem is that Kodi distributed with OSMC would have to be compiled to take advantage of it, and that means JRE would be “sold” with every Vero 4K+, and that’s what would cost money.

So, there would have to be two versions of the various “mediacenter” packages…one with JRE support and one without, and the second would be an option, not included with sales. Then, the “App Store” could just change a couple of settings on the system (maybe something like pointing to an alternate repository), and the next update would download the JRE-enabled Kodi and all dependencies. Also, two versions are required because JRE takes up a lot of disk space, and it might not even fit on some Pi installs.


#7

That’s not really the issue; it’s that users would also need to accept JRE usage terms. We’d have to introduce new terms for something we already ship. JRE is also massive. It’s larger than the OSMC image; and I’m not sure how many people would put it to good use. I haven’t tried with OpenJRE – but that’s something worth exploring too.

You’d also need duplicate versions of libbluray too.

The proper approach would be to use JRE if it’s there only.

Sam


#8

Can Kodi use JRE that way without changes you would have to make that would take away from much more important work?

Oh, and now I see…Debian used to have a “helper” package available in the repository that would install Oracle JRE by automating the download (but the user still had to accept the terms), but they have discontinued that because apparently Oracle is even more of a PITA company than before.


#9

I don’t think so – libbluray needs to try and load the library dynamically; but I can see that there’s currently a ./configure flag which requires specifying and linking against this library.

From a quick check, we wouldn’t need two builds of Kodi, just libbluray.


#10

That would help, then, as libbluray is small, and you could just make it part of the dependencies. After that, if people want to go for libaacs and the JRE, they can do it on their own. Although it would require the command line, the steps should be pretty easy.


#11

It should be tested with OpenJRE first, IMHO


#12

That’s a very good idea. Solves the licensing problem too.


#13

I’ve been testing with OpenJRE on CoreELEC but Kodi doesn’t like it… “DiscSettings - Could not load the java vm”. I guess it needs Oracle JRE.

How easy is it to compile a version of osmc-mediacenter with JRE support? Is it something I could do myself with instruction? Would be good to carry on testing…


#14

You should only need to compile libbluray with Java


#15

would be great if there’s a tutorial :wink:


#16

Ok, I have libbluray compiled with Java. The problem seems to be that Kodi can’t find/launch JRE. I have set JAVA_HOME to point to the jre folder in environment variables using .profile and checked it with env command. However I am still getting “DiscSettings - Could not load the java vm” error and logs don’t give any more info. Any ideas?


#17

Perhaps set JRE_HOME instead/also: https://stackoverflow.com/questions/39076261/difference-between-java-home-and-jre-home

And, although systemd runs Kodi (mediacenter) as user osmc, I don’t think it does any of the other things that would load the various profile/bashrc/whatever files. You might have to add the export command to the /usr/bin/mediacenter script.


#18

Unfortunately none of these suggestions work.

Is there any other way to export environment variables that mediacenter will recognise?


#19

Try setting in /usr/bin/mediacenter
Keep in mind that file is overwritten during updates;but it should be good for testing

Sam


#20

Is it likely that a libbluray.jar compiled in LibreELEC would work or would I need to recompile from scratch in OSMC?