[Solved] UMS on Ubuntu 18.04 and derivatives

For help and support with Linux-specific issues
Forum rules
Please make sure you follow the Problem Reporting Guidelines before posting if you want a reply
Post Reply
Hellbringer
Posts: 1
Joined: Mon Jul 02, 2018 5:04 pm

[Solved] UMS on Ubuntu 18.04 and derivatives

Post by Hellbringer » Mon Jul 02, 2018 5:29 pm

I just wanted to post this so that if anyone else ran into the same problems I had they could find out what the problem is. I didnt know if i should post here or on git, but figured it wasnt technically a bug and visibility is probably? better here.

I recently switched from minidlna to UMS for transcoding to my xbox360. I was running 17.10 artful which installs openjdk8 by default. No problems.

I upgraded to 18.04 Bionic and UMS stopped working. It wouldnt even launch. I reinstalled my jdk. Still nothing. Redownloaded. Nothing. Deleted .config, still nothing.

I assumed the upgrade broke it but couldn't figure out why. I launched the program from a terminal because the logs didn't even show anything. Terminal output was:

Code: Select all

Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/java/swing/plaf/windows/WindowsLookAndFeel                                                                                      
        at java.base/java.lang.ClassLoader.defineClass1(Native Method)                                                                                                                             
        at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1009)                                                                                                                      
        at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)                                                                                                       
        at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:801)
        at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:699)
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:622)
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:580)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:190)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)
        at net.pms.PMS.main(PMS.java:1145)
Caused by: java.lang.ClassNotFoundException: com.sun.java.swing.plaf.windows.WindowsLookAndFeel
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:190)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)
        ... 10 more
I googled this error and got some Bionic reviews talking about how *buntu was changing jdk to 10, then realized it had installed jdk 11 during the upgrade. Program worked fine after I removed that, but apparently this is the new default install option instead of 10.

Here's some articles talking about it. I don't know if something will break without jdk 11... I am on kubuntu/plasma. I guess I'll see.
https://www.phoronix.com/scan.php?page= ... nJDK-Plans
https://wiki.ubuntu.com/BionicBeaver/ReleaseNotes

Hopefully this post saves someone some effort. I figure if this is the new default, youre going to get more people running into this problem and I didn't see anyone else posting about it. I would hate for someone to give up on the program when the fix is easy. Also, thanks for the work, nice program. I appreciate a GUI program WITH a GUI config option.

Nadahar
Posts: 1245
Joined: Tue Jun 09, 2015 5:57 pm

Re: UMS on Ubuntu 18.04 and derivatives

Post by Nadahar » Fri Aug 10, 2018 2:00 pm

I guess we're going to see more of these now that Ubuntu has decided to go for the "new" Java versions. It's a sad choice in my opinion, because of the special situation that exists for Java. I'll paste a short explanation I made in another thread about the same issue today:
Nadahar wrote:
Fri Aug 10, 2018 8:44 am
UMS doesn't work with Java 9/10. This is a long story, but to try to make it short Oracle is making Java payware from Java 11. In preparation for this, they have made two "pretend" versions of Java (which only is valid 6 months each) that mostly removes stuff. They probably plan to offer some expensive "replacement" for those things later, I really don't know what they're up to.

Either way, Java 8 is the thing to use for now. It will be maintained for a good while still, and I guess we're all hoping for someone to come in and solve the mess Oracle is creating, or to watch Java slowly die. So, uninstall Java 10 and install the latest Java 8.
There's almost nothing useful in Java 9 & 10, but there are huge drawbacks. My guess is that a lot of the "Java world" will stay with Java 8 for the time being. It is possible to make workarounds for some of the problems Oracle has caused, but they release a new version every 6 months where they remove more stuff, so it's clear that we'd be bugged down just making workarounds for the stuff they sabotage if we were to go down that route.

A lot of people have the simplistic view that "newer is better". I disagree in many cases where bad decisions have been made in newer versions and especially when it comes to Java after Java 8.

vicentecarro
Posts: 1
Joined: Sat Oct 27, 2018 5:35 am

Re: UMS on Ubuntu 18.04 and derivatives

Post by vicentecarro » Sat Oct 27, 2018 5:40 am

So according this Java 8 won't be updating for free anymore after January...
https://www.theinquirer.net/inquirer/ne ... nuary-2019

Jacq1956
Posts: 5
Joined: Wed Mar 01, 2017 3:11 am

Re: UMS on Ubuntu 18.04 and derivatives

Post by Jacq1956 » Tue Oct 30, 2018 5:42 pm

Je pense que ceci devrait corriger la situation :
- sudo apt install openjdk-8-jdk
- sudo update-alternatives --config java (https://askubuntu.com/questions/994515/ ... ubuntu-way
J'ai essayé et ça marché.)
Bonne chance.

David0325
Posts: 12
Joined: Wed Apr 29, 2015 6:22 pm

Re: UMS on Ubuntu 18.04 and derivatives

Post by David0325 » Sun Nov 04, 2018 10:09 pm

Ubuntu 18.04, with UMS v7.x not OK, failed to start = error WindowsLookAndFeel reported in post #1
Easy to reproduce that issue with virtual machine.
Same issue with 7.1 ; 7.2 ; 7.3 ; 7.4 ; 7.5 running Ubuntu 18.04 with openjdk-8-jre installed.

If we use sudo update-alternatives --config java then another error see below (the last line) :

Code: Select all

user@user-VirtualBox:~$ sudo update-alternatives --config java
There are 2 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                            Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/java-11-openjdk-amd64/bin/java      1101      auto mode
* 1            /usr/lib/jvm/java-11-openjdk-amd64/bin/java      1101      manual mode
  2            /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java   1081      manual mode

Press <enter> to keep the current choice[*], or type selection number: 2
update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java to provide /usr/bin/java (java) in manual mode
user@user-VirtualBox:~$ '~/ums-7.5.0/UMS.sh' 
Error: Could not find or load main class net.pms.PMS
Same issue with openjdk-8-jdk installed.

User avatar
SubJunk
Lead Developer
Posts: 2782
Joined: Sun May 27, 2012 4:12 pm

Re: UMS on Ubuntu 18.04 and derivatives

Post by SubJunk » Mon Nov 05, 2018 8:33 am

We have a branch in progress that may fix this problem
It would help if someone can test it to let us know if it does
https://github.com/UniversalMediaServer ... /pull/1497

David0325
Posts: 12
Joined: Wed Apr 29, 2015 6:22 pm

Re: UMS on Ubuntu 18.04 and derivatives

Post by David0325 » Tue Nov 06, 2018 7:46 am

SubJunk wrote:
Mon Nov 05, 2018 8:33 am
We have a branch in progress that may fix this problem
It would help if someone can test it to let us know if it does
https://github.com/UniversalMediaServer ... /pull/1497
I will try, could you tell us where is the build to download to test please.

User avatar
SubJunk
Lead Developer
Posts: 2782
Joined: Sun May 27, 2012 4:12 pm

Re: UMS on Ubuntu 18.04 and derivatives

Post by SubJunk » Tue Nov 06, 2018 9:02 am

Hi David, I've uploaded the build to https://www.spirton.com/uploads/UMS/ums ... fb2dfd.tgz
Thanks!

David0325
Posts: 12
Joined: Wed Apr 29, 2015 6:22 pm

Re: UMS on Ubuntu 18.04 and derivatives

Post by David0325 » Wed Nov 07, 2018 6:33 am

SubJunk wrote:
Tue Nov 06, 2018 9:02 am
Hi David, I've uploaded the build to https://www.spirton.com/uploads/UMS/ums ... fb2dfd.tgz
Tested : that build started fine and works fine.
Image
Image

User avatar
SubJunk
Lead Developer
Posts: 2782
Joined: Sun May 27, 2012 4:12 pm

Re: UMS on Ubuntu 18.04 and derivatives

Post by SubJunk » Wed Nov 07, 2018 10:15 am

Thanks for the feedback, I will try to get that branch finished and merged for our next release

Post Reply