[gelöst]Programmstart funktioniert nicht über Starter (Java)

Du hast Probleme mit Deinem eMail-Programm, Webbrowser oder Textprogramm? Dein Lieblingsprogramm streikt?
Antworten
Benutzeravatar
Patsche
Beiträge: 3261
Registriert: 21.06.2013 01:47:54
Lizenz eigener Beiträge: MIT Lizenz
Wohnort: /home/10001101001

[gelöst]Programmstart funktioniert nicht über Starter (Java)

Beitrag von Patsche » 22.10.2015 18:17:12

Hey,

ich brauche mal eure Hilfe. Ich weiß nicht, ob ich vielleicht etwas übersehe. Ich habe hier das Programm Jamaica. Dieses ist ein Java-Programm. Es muss nicht installiert werden, es muss einfac nur ausgeführt werden.
Navigiere ich in diesen Ordner kann ich das Programm einfach starten mit:

Code: Alles auswählen

java -jar jameica-linux64.jar
Aber über einen Starter wirft mir das Programm nur Fehlermeldungen raus. Also

Code: Alles auswählen

java -jar /PFAD_ZUM_PROGRAMM/jameica-linux64.jar
Die Konfigurationseinstellungen speichert das Programm im Heimverzeichnis.
Das spuckt das Terminal aus:

Code: Alles auswählen

[Thu Oct 22 18:12:35 CEST 2015][INFO][de.willuhn.jameica.system.StartupParams.<init>] starting in STANDALONE mode
[Thu Oct 22 18:12:35 CEST 2015][INFO][de.willuhn.jameica.system.StartupParams.<init>] workdir: null
[Thu Oct 22 18:12:35 CEST 2015][INFO][de.willuhn.jameica.system.Application.init] starting jameica...
[Thu Oct 22 18:12:35 CEST 2015][INFO][de.willuhn.jameica.system.BootstrapSettings.getProperties] reading /home/sandra/.jameica.properties
[Thu Oct 22 18:12:35 CEST 2015][INFO][de.willuhn.jameica.system.WorkdirChooser.getWorkDir] using last used workdir /home/sandra/.jameica
[Thu Oct 22 18:12:35 CEST 2015][INFO][de.willuhn.jameica.system.Platform.getWorkdir] using workdir: /home/sandra/.jameica
[Thu Oct 22 18:12:35 CEST 2015][INFO][de.willuhn.jameica.system.Config.getLocale] configured language: de
[Thu Oct 22 18:12:35 CEST 2015][INFO][de.willuhn.jameica.system.Config.getLocale] configured country: DE
[Thu Oct 22 18:12:35 CEST 2015][INFO][de.willuhn.jameica.system.Config.getLocale] checking resource bundle for language
java.io.IOException: manifest /home/sandra/Förderverein/Stick-Programm/plugin.xml not readable
	at de.willuhn.jameica.plugin.Manifest.<init>(Manifest.java:74)
	at de.willuhn.jameica.system.Application.getManifest(Application.java:481)
	at de.willuhn.jameica.gui.GUI.getDisplay(GUI.java:890)
	at de.willuhn.jameica.gui.SplashScreen.<init>(SplashScreen.java:86)
	at de.willuhn.jameica.system.ApplicationCallbackSWT.getStartupMonitor(ApplicationCallbackSWT.java:175)
	at de.willuhn.jameica.system.Application.init(Application.java:100)
	at de.willuhn.jameica.system.Application.newInstance(Application.java:90)
	at de.willuhn.jameica.Main.main(Main.java:78)
[Thu Oct 22 18:12:35 CEST 2015][INFO][de.willuhn.jameica.system.Config.getLocale] active language: Deutsch (Deutschland)
[Thu Oct 22 18:12:35 CEST 2015][INFO][de.willuhn.util.I18N.<init>] loading resource bundle lang/system_messages for locale de_DE
[Thu Oct 22 18:12:35 CEST 2015][ERROR][de.willuhn.jameica.system.Application.startupError] FATAL ERROR WHILE JAMEICA STARTUP
java.io.IOException: manifest /home/sandra/Förderverein/Stick-Programm/plugin.xml not readable
	at de.willuhn.jameica.plugin.Manifest.<init>(Manifest.java:74)
	at de.willuhn.jameica.system.Application.getManifest(Application.java:481)
	at de.willuhn.jameica.gui.GUI.getDisplay(GUI.java:890)
	at de.willuhn.jameica.gui.SplashScreen.<init>(SplashScreen.java:86)
	at de.willuhn.jameica.system.ApplicationCallbackSWT.getStartupMonitor(ApplicationCallbackSWT.java:175)
	at de.willuhn.jameica.system.Application.init(Application.java:100)
	at de.willuhn.jameica.system.Application.newInstance(Application.java:90)
	at de.willuhn.jameica.Main.main(Main.java:78)


Diese plugin.xml existiert auch nicht. Aber warum funktioniert der direkte Aufruf? So sieht der Start aus, wenn es funktioniert:

Code: Alles auswählen

[Thu Oct 22 18:15:40 CEST 2015][INFO][de.willuhn.jameica.system.StartupParams.<init>] starting in STANDALONE mode
[Thu Oct 22 18:15:40 CEST 2015][INFO][de.willuhn.jameica.system.StartupParams.<init>] workdir: null
[Thu Oct 22 18:15:40 CEST 2015][INFO][de.willuhn.jameica.system.Application.init] starting jameica...
[Thu Oct 22 18:15:40 CEST 2015][INFO][de.willuhn.jameica.system.BootstrapSettings.getProperties] reading /home/sandra/.jameica.properties
[Thu Oct 22 18:15:40 CEST 2015][INFO][de.willuhn.jameica.system.WorkdirChooser.getWorkDir] using last used workdir /home/sandra/.jameica
[Thu Oct 22 18:15:40 CEST 2015][INFO][de.willuhn.jameica.system.Platform.getWorkdir] using workdir: /home/sandra/.jameica
[Thu Oct 22 18:15:40 CEST 2015][INFO][de.willuhn.jameica.system.Config.getLocale] configured language: de
[Thu Oct 22 18:15:40 CEST 2015][INFO][de.willuhn.jameica.system.Config.getLocale] configured country: DE
[Thu Oct 22 18:15:40 CEST 2015][INFO][de.willuhn.jameica.system.Config.getLocale] checking resource bundle for language
[Thu Oct 22 18:15:40 CEST 2015][INFO][de.willuhn.jameica.system.Config.getLocale] active language: Deutsch (Deutschland)
[Thu Oct 22 18:15:40 CEST 2015][INFO][de.willuhn.util.I18N.<init>] loading resource bundle lang/system_messages for locale de_DE
[Thu Oct 22 18:15:40 CEST 2015][INFO][de.willuhn.jameica.plugin.Manifest.<init>] Jameica 2.6.2
[Thu Oct 22 18:15:40 CEST 2015][INFO][de.willuhn.jameica.plugin.Manifest.<init>]   Directory  : /home/sandra/Förderverein/Stick-Programm/Portable/Linux/jameica
[Thu Oct 22 18:15:40 CEST 2015][INFO][de.willuhn.jameica.gui.SplashScreen$3.run]  starting jameica ...
[Thu Oct 22 18:15:40 CEST 2015][INFO][de.willuhn.jameica.services.SecurityManagerService.init] applying jameica security manager
[Thu Oct 22 18:15:40 CEST 2015][INFO][de.willuhn.jameica.security.JameicaSecurityManager.<init>] protecting program dir /home/sandra/Förderverein/Stick-Programm/Portable/Linux/jameica/
[Thu Oct 22 18:15:40 CEST 2015][INFO][de.willuhn.jameica.services.LockService.init] creating lockfile /home/sandra/.jameica/jameica.lock
[Thu Oct 22 18:15:40 CEST 2015][INFO][de.willuhn.jameica.services.LockService.init] /home/sandra/.jameica/jameica.lock successfully locked
[Thu Oct 22 18:15:40 CEST 2015][INFO][de.willuhn.jameica.services.LogService.init] using log level INFO [100]
[Thu Oct 22 18:15:40 CEST 2015][INFO][de.willuhn.jameica.services.LogService.init] log file /home/sandra/.jameica/jameica.log
[Thu Oct 22 18:15:40 CEST 2015][INFO][de.willuhn.jameica.services.LogService.init] log size 1048576 bytes
[Thu Oct 22 18:15:40 CEST 2015][INFO][de.willuhn.jameica.services.SysPropertyService.init] setting sys property (from presets): java.net.preferIPv4Stack: true
[Thu Oct 22 18:15:40 CEST 2015][INFO][de.willuhn.jameica.services.SysinfoService.init] starting Jameica Version 2.6.2
[Thu Oct 22 18:15:40 CEST 2015][INFO][de.willuhn.jameica.services.SysinfoService.init]   Built-Date : 20150106
[Thu Oct 22 18:15:40 CEST 2015][INFO][de.willuhn.jameica.services.SysinfoService.init]   Buildnumber: 440
[Thu Oct 22 18:15:40 CEST 2015][INFO][de.willuhn.jameica.services.SysinfoService.init]   max. memory: 878mb
[Thu Oct 22 18:15:40 CEST 2015][INFO][de.willuhn.jameica.services.SysinfoService.init]   sys charset: UTF-8
[Thu Oct 22 18:15:40 CEST 2015][INFO][de.willuhn.jameica.services.SysinfoService.init] command line parameters
[Thu Oct 22 18:15:40 CEST 2015][INFO][de.willuhn.jameica.services.SysinfoService.init] os.arch          : amd64
[Thu Oct 22 18:15:40 CEST 2015][INFO][de.willuhn.jameica.services.SysinfoService.init] os.name          : Linux
[Thu Oct 22 18:15:40 CEST 2015][INFO][de.willuhn.jameica.services.SysinfoService.init] os.version       : 4.2.0-1-amd64
[Thu Oct 22 18:15:40 CEST 2015][INFO][de.willuhn.jameica.services.SysinfoService.init] java.version     : 1.7.0_85
[Thu Oct 22 18:15:40 CEST 2015][INFO][de.willuhn.jameica.services.SysinfoService.init] java.vendor      : Oracle Corporation
[Thu Oct 22 18:15:40 CEST 2015][INFO][de.willuhn.jameica.services.SysinfoService.init] java.runtime.name: OpenJDK Runtime Environment
[Thu Oct 22 18:15:40 CEST 2015][INFO][de.willuhn.jameica.services.SysinfoService.init] java.vm.name     : OpenJDK 64-Bit Server VM
[Thu Oct 22 18:15:40 CEST 2015][INFO][de.willuhn.jameica.services.SysinfoService.init] user.name        : sandra
[Thu Oct 22 18:15:40 CEST 2015][INFO][de.willuhn.jameica.services.SysinfoService.init] user.home        : /home/sandra
[Thu Oct 22 18:15:40 CEST 2015][INFO][de.willuhn.jameica.services.SysinfoService.init] file.encoding    : UTF-8
[Thu Oct 22 18:15:40 CEST 2015][INFO][de.willuhn.jameica.messaging.NamedConcurrentQueue.init] creating thread pool
[Thu Oct 22 18:15:40 CEST 2015][INFO][de.willuhn.jameica.services.HostnameVerifierService.init] applying jameica's hostname verifier
[Thu Oct 22 18:15:41 CEST 2015][INFO][de.willuhn.jameica.security.SSLFactory.<clinit>] applying security provider BouncyCastle Security Provider v1.44
[Thu Oct 22 18:15:41 CEST 2015][INFO][de.willuhn.jameica.security.SSLFactory.init] init ssl factory
[Thu Oct 22 18:15:41 CEST 2015][INFO][de.willuhn.jameica.gui.SplashScreen$3.run]  init ssl factory ...
[Thu Oct 22 18:15:41 CEST 2015][INFO][de.willuhn.jameica.security.SSLFactory.getKeyStore] init keystore /home/sandra/.jameica/cfg/jameica.keystore
[Thu Oct 22 18:15:41 CEST 2015][INFO][de.willuhn.jameica.security.SSLFactory.getKeyStore] trying to unlock keystore
[Thu Oct 22 18:15:41 CEST 2015][INFO][de.willuhn.jameica.gui.util.Font.<clinit>] system font: 1|Sans|10.0|0|GTK|1|
Was übersehe ich?
Vielen Dank für eure Hilfe und Zeit.
Zuletzt geändert von Patsche am 22.10.2015 18:39:06, insgesamt 1-mal geändert.

DeletedUserReAsG

Re: Programmstart funktioniert nicht über Starter (Java)

Beitrag von DeletedUserReAsG » 22.10.2015 18:21:52

Es sieht so aus, als würde es z.T. relative Pfade verwenden. Workaround könnte sein, das cd /pfad/zum/jar; in den Starter mit aufzunehmen. Je nach DE besteht auch die Möglichkeit, das Arbeitsverzeichnis dort direkt anzugeben.

Benutzeravatar
Patsche
Beiträge: 3261
Registriert: 21.06.2013 01:47:54
Lizenz eigener Beiträge: MIT Lizenz
Wohnort: /home/10001101001

Re: Programmstart funktioniert nicht über Starter (Java)

Beitrag von Patsche » 22.10.2015 18:33:16

niemand hat geschrieben:Es sieht so aus, als würde es z.T. relative Pfade verwenden.
Du hast Recht. Woran hast du das erkannt? Habe mir jetzt ein Shellskript gebastelt, welches erst mit cd ins Verzeichbnis wechselt und dan das Programm ausführt. Das funktioniert. Auf die Idee wäre ich jetzt auch nicht gekommen.
Ist das nicht ein schlechter Programmierstil mir relativen Pfaden zu arbeiten?
Danke für die schnelle Hilfe.

Edit:
Oh nein. Jetzt habe ich auch fertiges Shellskript im Ordner entdeckt. Das enthält folgendes:

Code: Alles auswählen

#!/bin/sh

# Linux Start-Script fuer regulaeren Standalone-Betrieb.
# Jameica wird hierbei mit GUI gestartet.

#_JCONSOLE="-Dcom.sun.management.jmxremote"

# https://www.willuhn.de/bugzilla/show_bug.cgi?id=774
# https://www.willuhn.de/bugzilla/show_bug.cgi?id=798

link=$(readlink -f "$0")
dir=$(dirname "$link")
cd "$dir" 

bit=`uname -m |grep 64`
if [ $? = 0 ]
 then LIBOVERLAY_SCROLLBAR=0 GDK_NATIVE_WINDOWS=1 SWT_GTK3=0 java -Djava.net.preferIPv4Stack=true -Xmx256m $_JCONSOLE -jar jameica-linux64.jar $@
 else LIBOVERLAY_SCROLLBAR=0 GDK_NATIVE_WINDOWS=1 SWT_GTK3=0 java -Djava.net.preferIPv4Stack=true -Xmx256m $_JCONSOLE -jar jameica-linux.jar $@
fi
Sieht auch irgendwie wild aus, aber es funktioniert. Tut mir Leid, hätte ich auch vorher drauf kommen können, dass es ein fertiges Skript gibt. Nochmals vielen Dank.

Antworten