0
votes

I have an installer which is supposed to fall back to console mode if my Unix system does not have any X11 server or GUI mode available. The following is the configuration I have set for the Installer:

enter image description here

Now according to the fallback option, it should automatically run if console execution is enabled even if I do not run the installer using [installer] -c command (it should also be the normal use case). But unfortunately, whenever I execute the installer directly in the console mode, it is throwing an exception. The exception log is the following:

java.lang.NoClassDefFoundError: java.awt.Container
    at com.install4j.runtime.installer.frontend.headless.AbstractHeadlessScreenExecutor.init(AbstractHeadlessScreenExecutor.java:67)
    at com.install4j.runtime.installer.frontend.headless.ConsoleScreenExecutor.<init>(ConsoleScreenExecutor.java:24)
    at com.install4j.runtime.installer.frontend.headless.InstallerConsoleScreenExecutor.<init>(InstallerConsoleScreenExecutor.java:6)
    at com.install4j.runtime.installer.Installer.getScreenExecutor(Installer.java:88)
    at com.install4j.runtime.installer.Installer.runInProcess(Installer.java:57)
    at com.install4j.runtime.installer.Installer.main(Installer.java:45)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:81)
    at com.install4j.runtime.launcher.UnixLauncher.main(UnixLauncher.java:62)

I have tried with Install4j 6.1.4 then also upgraded it with 7.0.3, the behavior is the same. My Linux installation is CentOS 7 Server and the installer has Java JRE 1.7.80 bundled with it.

Is there anything missing in my CentOS that install4j requires? Or do I have to configure anything else in my Installer so that it functions properly? I tried with the -c and it works in that case.

1
It seems that you are trying to run with a headless JRE that does not have the AWT classes - Ingo Kegel
But it runs when I start the installer using -c command. Does it no require any AWT classes when I run it manually in console mode?? - ShaDooW

1 Answers

0
votes

The fallback currently tries to initialize a window and failing that switches to headless mode. On your system, headless mode does not seems to work in that case.

I'll add a different kind of headless check using GraphicsEnvironment.isHeadless(), please ask [email protected] for a build where this is available.