Page 1 of 1

Compiling source code returns error

Posted: Thu Sep 10, 2026 5:47 am
by binary512
When compiling UMS v15.8.2, I get the following error(s) and the compilation is not successful. I am using WIndows 10 22H2.
I am using the following versions: Java SDK 26.0.2.1, GIT 2.55.0.5, MediaInfo 26.05, and Maven 1.06.
The program compiled successfully with UMS v15.5.0 and Java SDK 26.0.0.0, GIT 2.53.0.3, MediaInfo 26.01 and Maven 1.05.

When trying to compile UMS v15.5 now, I get the same errors as with v15.8.2. Is there a bug with one of the updates (Java SDK, GIT, MediaInfo or Maven)?
The error always happens with this FFmpegVideoTest function.
Thank you.

-------------------------------------------------------------------------------
Test set: net.pms.encoders.FFmpegVideoTest
-------------------------------------------------------------------------------
Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.092 s <<< FAILURE! -- in net.pms.encoders.FFmpegVideoTest
net.pms.encoders.FFmpegVideoTest.testHardcodingSubtitles -- Time elapsed: 0.045 s <<< ERROR!
java.lang.NullPointerException: Cannot invoke "java.util.List.iterator()" because "ffmpegOutput" is null
at net.pms.encoders.FFmpegVideoTest.testHardcodingSubtitles(FFmpegVideoTest.java:157)

net.pms.encoders.FFmpegVideoTest.testDolbyVisionOutput -- Time elapsed: 0.039 s <<< ERROR!
java.lang.NullPointerException: Cannot invoke "java.util.List.iterator()" because "ffmpegOutput" is null
at net.pms.encoders.FFmpegVideoTest.testDolbyVisionOutput(FFmpegVideoTest.java:116)

Re: Compiling source code returns error

Posted: Thu Sep 10, 2026 10:17 am
by mik_s
I did have errors running my build script a few versions ago.

It was giving me errors about outdated versions of JDK and apache-maven as they are using newer versions now.
I don't think these are a part of the build configuration so won't get automatically updated. I had to download them myself.

I am now using jdk-25.0.4.1 and apache-maven-3.9.16, altered the script to use these and has been working well. I just ran a build of the newest release.

I did have an issue with failing tests as the test build database had been corrupted so was causing errors but this should be fixed now. Deleting C:\ProgramData\UMS-tests fixed it for me.

If it compiles fine but fails tests you can add the "-DskipTests" flag to mvn to skip them so it continues.
Might be best to backup your database using the new option in the tools menu before installing so if it gets corrupt you can delete it to start fresh then restore played status.

Re: Compiling source code returns error

Posted: Thu Sep 10, 2026 10:57 pm
by binary512
I deleted C:\ProgramData\UMS-tests. The SkipTests flag gets past the tests. Now I am getting the following error when trying to create the install executable...the "jre17" sub-directory doesn't exist.
All prior messages show successful.

[INFO] --- nsis:1.0.6:make (build-setup-windows-x86_64) @ ums ---
[INFO] Executing: C:\Users\Kurt\UniversalMediaServer\src\main\external-resources\windows\nsis\makensis.exe /X!include C:\Users\Kurt\UniversalMediaServer\target\project.nsh /XOutFile C:\Users\Kurt\UniversalMediaServer\target\UMS-x86_64.exe /V2 C:\Users\Kurt\UniversalMediaServer\target\setup-x86_64.nsi
[INFO] [MAKENSIS] File: "C:\Users\Kurt\UniversalMediaServer\target\bin\windows\x86_64\jre17" -> no files found.
[INFO] [MAKENSIS] Usage: File [/nonfatal] [/a] ([/r] [/x filespec [...]] filespec [...] |
[INFO] [MAKENSIS] /oname=outfile one_file_only)
[INFO] [MAKENSIS] Error in script "C:\Users\Kurt\UniversalMediaServer\target\setup-x86_64.nsi" on line 470 -- aborting creation process

Re: Compiling source code returns error

Posted: Fri Sep 11, 2026 1:36 am
by mik_s
I don't know exactly your setup as I was given a script to do it.

Try deleting (or renaming) the source code folder and rerun the GIT_clone and GIT_update instructions so everything is downloaded again fresh.
This is the first thing I try if I ever get a build error as I sometimes experiment making my script better and sometimes that might mess things up.

Looking at that nsi file line 470

Code: Select all

		File /r "${PROJECT_BUILD_DIR}\bin\windows\x86_64\jre${PROJECT_JRE_VERSION}"
I think {PROJECT_JRE_VERSION} might be an environment variable on your system.
If I understand that part is is checking if the right binaries are there.

Make sure to change the system path to the jdk25 and not jdk17.

This is what I have at the start of my script where I updated those versions and commented out the original lines.

Code: Select all

REM SET JAVA_HOME=%CD%\jdk-17
REM SET M2_HOME=%CD%\apache-maven
SET JAVA_HOME=%CD%\jdk-25.0.4.1
SET M2_HOME=%CD%\apache-maven-3.9.16
SET M2=%M2_HOME%\bin
Set PATH=%M2%;%JAVA_HOME%\bin;%PATH%
I probably should not show any more of this script but hopefully this will help.

Re: Compiling source code returns error

Posted: Fri Sep 11, 2026 5:14 am
by binary512
I have deleted and re-downloaded the source code every build so I start from scratch.
{PROJECT_JRE_VERSION} comes from the UMS compiler files UMS.NSI and SETUP-X86_64.NSI.

My environment variables are:
JAVA_HOME=C:\Program Files\Java\jdk-26.0.2.1
M2=C:\Users\Kurt\Documents\maven\bin
M2_HOME=C:\Users\Kurt\Documents\maven
PATH=C:\Program Files\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Oracle\Java\java8path;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Users\Kurt\adb-fastboot\platform-tools;C:\Program Files\MediaInfo;C:\Program Files\Git\cmd;C:\Program Files\Java\jdk-26.0.2.1\bin;C:\Users\Kurt\AppData\Local\Microsoft\WindowsApps;C:\Users\Kurt\Documents\maven\bin;

I am still getting the error. Could there be any conflict with Java Runtime Environment being installed also??? I have the most recent version of JRE installed v8.0.503.0.
I uninstalled the JRE and still get the same error. The UMS build is getting "17" as the JRE build, although I am not sure where exactly.
I have also tried Oracle's Java Development Kit, in addition to the one recommended in the documentation.
I have run out of ideas. Would it help if I posted the entire log file. It's not that big.

Re: Compiling source code returns error

Posted: Fri Sep 11, 2026 12:17 pm
by mik_s
I just deleted my code folder and ran the script and it worked fine for me.
I should note that I do not have Java installed, just the extracted folders for jdk and apache-maven in the same folder as the code folder and the build script.

In my target folder it is indeed jre17 that is downloaded as that is what is currently used for the main release, but I think they are moving to 25 in v16. I had been testing that version so jre25 in there previously.

Maybe since you have a java version already installed on your system it is confusing it and did not download the right jre version.
This could be why it was failing the ffmpeg test as it could not run jre so was getting no result.

All I can suggest is uninstall Java (unless other programs use it) and set up your build folder the same way as mine.
It might be you have to download jre17 separately and copy it to "C:\Users\Kurt\UniversalMediaServer\target\bin\windows\x86_64\jre17"

I think most of the work in the script is done by calling a java file so I don't know how it actually works and don't know enough to say specifically what is causing the issue.

Re: Compiling source code returns error

Posted: Fri Sep 11, 2026 1:01 pm
by binary512
Re: "In my target folder it is indeed jre17 that is downloaded..."
How is jre17 downloaded??? Does this happen during the Build process?

Re: "It might be you have to download jre17 separately..."
From where??? Can you supply a link? I think if I do this manually, it would solve the problem. But I need a link.

Thanks.

Re: Compiling source code returns error

Posted: Sat Sep 12, 2026 1:40 am
by mik_s
Sorry I don't know. I assume this java program that is called in the script does it for me.

I don't have a link to jre17, maybe it is bundled in one of the Java distributions?
As I understand it the pom.xml is the build instructions that maybe has the download link for dependencies so you could try having a look at that for links.

Re: Compiling source code returns error

Posted: Sat Sep 19, 2026 11:58 pm
by binary512
As a workaround, I downloaded and installed both the 32-bit and 64-bit Java Runtime Environment and then manually copied the appropriate directories to the JRE17 subdirectory of the UMS project.
This allowed the compilation to complete successfully.
Still cannot explain how those JRE17 directories are supposed to be populated automatically...