[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Ask for help on new pkg xperia-flashtool on classpath



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:
>
> ====
> $ 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™, you
cannot use both -cp (to set the classpath) and -jar (to
run a JAR file).

Rather, you’ll have to set the classpath to the dependencies
*and* your JAR file, and run the main class with it, so
something like… best to put it into a shell script to launch:

#!/bin/sh
java -cp /usr/share/xperia-flashtool/x10flasher.jar:/usr/share/java/log4j-core.jar:$more_dependencies gui.Main "$@"

The “gui.Main” is the entry point which “java -jar” 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 “Main-Class:” entry therein.

HTH & HAND,
//mirabilos
-- 
tarent solutions GmbH
Rochusstraße 2-4, D-53123 Bonn • http://www.tarent.de/
Tel: +49 228 54881-393 • Fax: +49 228 54881-235
HRB 5168 (AG Bonn) • USt-ID (VAT): DE122264941
Geschäftsführer: Dr. Stefan Barth, Kai Ebenrett, Boris Esser, Alexander Steeg

*************************************************

Mit unserem Consulting bieten wir Unternehmen maßgeschneiderte Angebote 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.

*************************************************


Reply to: