Path: csiph.com!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!news.dns-netz.com!news.freedyn.net!aioe.org!bofh.it!news.nic.it!robomod From: Thorsten Glaser Newsgroups: linux.debian.maint.java Subject: Re: Ask for help on new pkg xperia-flashtool on classpath Date: Mon, 07 Dec 2020 18:10:02 +0100 Message-ID: References: X-Mailbox-Line: From debian-java-request@lists.debian.org Mon Dec 7 17:02:09 2020 Old-Return-Path: X-Amavis-Spam-Status: No, score=-6.625 tagged_above=-10000 required=5.3 tests=[BAYES_00=-2, FOURLA=0.1, KHOP_HELO_FCRDNS=0.275, LDO_WHITELIST=-5] autolearn=ham autolearn_force=no X-Policyd-Weight: using cached result; rate:hard: -3.5 Content-Language: de-DE-1901 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Mailing-List: archive/latest/22599 List-ID: List-URL: List-Archive: https://lists.debian.org/msgid-search/a71ba9b-3e6-fbe9-8f42-edf5897dd8d@tarent.de Approved: robomod@news.nic.it Lines: 50 Organization: linux.* mail to news gateway Sender: robomod@news.nic.it X-Original-Cc: debian-java@lists.debian.org X-Original-Date: Mon, 7 Dec 2020 18:01:47 +0100 (CET) X-Original-Message-ID: X-Original-References: Xref: csiph.com linux.debian.maint.java:11974 On Tue, 8 Dec 2020, Roger Shimizu wrote: > However the pkg still cannot be used due to classpath issue, I guess. > After installing xperia-flashtool, and run java command, it report error: > > =3D=3D=3D=3D > $ java -jar /usr/share/xperia-flashtool/x10flasher.jar > I tried to add classpath, such as"-cp /usr/share/java/log4j-core.jar", This is really tricky. Due to a shortcoming in Java=E2=84=A2, you cannot use both -cp (to set the classpath) and -jar (to run a JAR file). Rather, you=E2=80=99ll have to set the classpath to the dependencies *and* your JAR file, and run the main class with it, so something like=E2=80=A6 best to put it into a shell script to launch: #!/bin/sh java -cp /usr/share/xperia-flashtool/x10flasher.jar:/usr/share/java/log4j-c= ore.jar:$more_dependencies gui.Main "$@" The =E2=80=9Cgui.Main=E2=80=9D is the entry point which =E2=80=9Cjava -jar= =E2=80=9D finds automatically; you get it by looking into the JAR file as if it were a PKZIP archive, extracting the META-INF/MANIFEST.MF file and looking at the =E2=80=9CMain-Class:=E2=80=9D entry therein. HTH & HAND, //mirabilos --=20 tarent solutions GmbH Rochusstra=C3=9Fe 2-4, D-53123 Bonn =E2=80=A2 http://www.tarent.de/ Tel: +49 228 54881-393 =E2=80=A2 Fax: +49 228 54881-235 HRB 5168 (AG Bonn) =E2=80=A2 USt-ID (VAT): DE122264941 Gesch=C3=A4ftsf=C3=BChrer: Dr. Stefan Barth, Kai Ebenrett, Boris Esser, Ale= xander Steeg ************************************************* Mit unserem Consulting bieten wir Unternehmen ma=C3=9Fgeschneiderte Angebot= e in Form von Beratung, Trainings sowie Workshops in den Bereichen Softwaretechnologie, IT Strategie und Architektur, Innovation und Umsetzung sowie Agile Organisation. Besuchen Sie uns auf https://www.tarent.de/consulting . Wir freuen uns auf Ihren Kontakt. *************************************************