Build error for Jibri from code

I want to build Jibri package from source code and when I run mvn clean package, it will fail with following error.

[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[DEBUG] incrementalBuildHelper#beforeRebuildExecution
[INFO] Compiling 1 source file to /home/ubuntu/jibri/target/classes
[DEBUG] incrementalBuildHelper#afterRebuildExecution
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  26.338 s
[INFO] Finished at: 2022-07-02T10:16:44Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (java-compile) on project jibri: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[ERROR] 
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (java-compile) on project jibri: Compilation failure
No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: org.apache.maven.plugin.compiler.CompilationFailureException: Compilation failure
No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

    at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute (AbstractCompilerMojo.java:1220)
    at org.apache.maven.plugin.compiler.CompilerMojo.execute (CompilerMojo.java:187)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
[ERROR] 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

Can someone please help on this?

Environment detail as below:
EC2 Ubuntu 18.04
openjdk version “1.8.0_312”

Setup, so javac is in the path and have java_home setup and use java 11

Thanks a lot @damencho

I was able to generate Jar file from source code, But when I place the file in server, and restart the service. seems like does not work. System logs show as below. Can you please help on this.

Thanks

Jul 03 02:48:56 ip-172-31-28-50 systemd[1]: Stopping Jibri Process...
Jul 03 02:48:56 ip-172-31-28-50 graceful_shutdown.sh[18570]:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
Jul 03 02:48:56 ip-172-31-28-50 launch.sh[18143]: #
Jul 03 02:48:56 ip-172-31-28-50 launch.sh[18143]: # A fatal error has been detected by the Java Runtime Environment:
Jul 03 02:48:56 ip-172-31-28-50 launch.sh[18143]: #
Jul 03 02:48:56 ip-172-31-28-50 launch.sh[18143]: #  SIGBUS (0x7) at pc=0x00007f2bc6a9aec0, pid=18143, tid=0x00007f2ba9077700
Jul 03 02:48:56 ip-172-31-28-50 launch.sh[18143]: #
Jul 03 02:48:56 ip-172-31-28-50 launch.sh[18143]: # JRE version: OpenJDK Runtime Environment (8.0_312-b07) (build 1.8.0_312-8u312-b07-0ubuntu1~18.04-b07)
Jul 03 02:48:56 ip-172-31-28-50 launch.sh[18143]: # Java VM: OpenJDK 64-Bit Server VM (25.312-b07 mixed mode linux-amd64 compressed oops)
Jul 03 02:48:56 ip-172-31-28-50 launch.sh[18143]: # Problematic frame:
Jul 03 02:48:56 ip-172-31-28-50 launch.sh[18143]: # C  [libzip.so+0x4ec0]
Jul 03 02:48:56 ip-172-31-28-50 launch.sh[18143]: #
Jul 03 02:48:56 ip-172-31-28-50 launch.sh[18143]: # Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
Jul 03 02:48:56 ip-172-31-28-50 launch.sh[18143]: #
Jul 03 02:48:56 ip-172-31-28-50 launch.sh[18143]: # An error report file with more information is saved as:
Jul 03 02:48:56 ip-172-31-28-50 launch.sh[18143]: # /tmp/hs_err_pid18143.log
Jul 03 02:48:56 ip-172-31-28-50 launch.sh[18143]: Compiled method (nm)  534995  282     n 0       java.util.zip.ZipFile::getEntry (native)
Jul 03 02:48:56 ip-172-31-28-50 launch.sh[18143]:  total in heap  [0x00007f2bb1197b50,0x00007f2bb1197ec0] = 880
Jul 03 02:48:56 ip-172-31-28-50 launch.sh[18143]:  relocation     [0x00007f2bb1197c78,0x00007f2bb1197cc0] = 72
Jul 03 02:48:56 ip-172-31-28-50 launch.sh[18143]:  main code      [0x00007f2bb1197cc0,0x00007f2bb1197ec0] = 512
Jul 03 02:48:56 ip-172-31-28-50 graceful_shutdown.sh[18570]:                                  Dload  Upload   Total   Spent    Left  Speed
Jul 03 02:48:57 ip-172-31-28-50 graceful_shutdown.sh[18570]: [158B blob data]
Jul 03 02:48:57 ip-172-31-28-50 graceful_shutdown.sh[18570]: curl: (56) Recv failure: Connection reset by peer
Jul 03 02:48:57 ip-172-31-28-50 systemd[1]: jibri.service: Main process exited, code=killed, status=11/SEGV
Jul 03 02:48:57 ip-172-31-28-50 systemd[1]: jibri.service: Control process exited, code=exited status=56
Jul 03 02:48:57 ip-172-31-28-50 systemd[1]: jibri.service: Failed with result 'signal'.
Jul 03 02:48:57 ip-172-31-28-50 systemd[1]: Stopped Jibri Process.
Jul 03 02:48:57 ip-172-31-28-50 systemd[1]: Started Jibri Process.
Jul 03 02:48:57 ip-172-31-28-50 systemd[1]: jibri.service: Main process exited, code=exited, status=1/FAILURE
Jul 03 02:48:57 ip-172-31-28-50 systemd[1]: jibri.service: Failed with result 'exit-code'.
Jul 03 02:48:57 ip-172-31-28-50 systemd[1]: jibri.service: Service hold-off time over, scheduling restart.
Jul 03 02:48:57 ip-172-31-28-50 systemd[1]: jibri.service: Scheduled restart job, restart counter is at 1.
Jul 03 02:48:57 ip-172-31-28-50 systemd[1]: Stopped Jibri Process.
Jul 03 02:48:57 ip-172-31-28-50 systemd[1]: Started Jibri Process.
Jul 03 02:48:57 ip-172-31-28-50 systemd[1]: jibri.service: Main process exited, code=exited, status=1/FAILURE
Jul 03 02:48:57 ip-172-31-28-50 systemd[1]: jibri.service: Failed with result 'exit-code'.
Jul 03 02:48:57 ip-172-31-28-50 systemd[1]: jibri.service: Service hold-off time over, scheduling restart.
Jul 03 02:48:57 ip-172-31-28-50 systemd[1]: jibri.service: Scheduled restart job, restart counter is at 2.
Jul 03 02:48:57 ip-172-31-28-50 systemd[1]: Stopped Jibri Process.
Jul 03 02:48:57 ip-172-31-28-50 systemd[1]: Started Jibri Process.
Jul 03 02:48:58 ip-172-31-28-50 systemd[1]: jibri.service: Main process exited, code=exited, status=1/FAILURE
Jul 03 02:48:58 ip-172-31-28-50 systemd[1]: jibri.service: Failed with result 'exit-code'.
Jul 03 02:48:58 ip-172-31-28-50 systemd[1]: jibri.service: Service hold-off time over, scheduling restart.
Jul 03 02:48:58 ip-172-31-28-50 systemd[1]: jibri.service: Scheduled restart job, restart counter is at 3.
Jul 03 02:48:58 ip-172-31-28-50 systemd[1]: Stopped Jibri Process.
Jul 03 02:48:58 ip-172-31-28-50 systemd[1]: Started Jibri Process.
Jul 03 02:48:58 ip-172-31-28-50 systemd[1]: jibri.service: Main process exited, code=exited, status=1/FAILURE
Jul 03 02:48:58 ip-172-31-28-50 systemd[1]: jibri.service: Failed with result 'exit-code'.
Jul 03 02:48:58 ip-172-31-28-50 systemd[1]: jibri.service: Service hold-off time over, scheduling restart.
Jul 03 02:48:58 ip-172-31-28-50 systemd[1]: jibri.service: Scheduled restart job, restart counter is at 4.
Jul 03 02:48:58 ip-172-31-28-50 systemd[1]: Stopped Jibri Process.
Jul 03 02:48:58 ip-172-31-28-50 systemd[1]: Started Jibri Process.
Jul 03 02:48:59 ip-172-31-28-50 systemd[1]: jibri.service: Main process exited, code=exited, status=1/FAILURE
Jul 03 02:48:59 ip-172-31-28-50 systemd[1]: jibri.service: Failed with result 'exit-code'.
Jul 03 02:48:59 ip-172-31-28-50 systemd[1]: jibri.service: Service hold-off time over, scheduling restart.
Jul 03 02:48:59 ip-172-31-28-50 systemd[1]: jibri.service: Scheduled restart job, restart counter is at 5.
Jul 03 02:48:59 ip-172-31-28-50 systemd[1]: Stopped Jibri Process.
Jul 03 02:48:59 ip-172-31-28-50 systemd[1]: jibri.service: Start request repeated too quickly.
Jul 03 02:48:59 ip-172-31-28-50 systemd[1]: jibri.service: Failed with result 'exit-code'.
Jul 03 02:48:59 ip-172-31-28-50 systemd[1]: Failed to start Jibri Process.

You need to check jibri logs, why did it fail in /var/log/jitsi