On Tue, Dec 8, 2020 at 2:01 AM Thorsten Glaser <t.gla...@tarent.de> wrote: > > 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 "$@"
Thanks for the hint! Below command already shows different a classpath error, so it's moved forward. $ java -cp /usr/share/xperia-flashtool/x10flasher.jar:/usr/share/java/log4j-core.jar:/usr/share/java/log4j-api.jar 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. Yes, it set up by build.xml of ant. So my next question is, how to figure out all the classpath, since this package really depends on a lot of java libraries. I tried to set up the classpath automatically by patch, which seems failed: * https://salsa.debian.org/java-team/xperia-flashtool/-/blob/master/debian/patches/02-classpath.patch Cheers, -- Roger Shimizu, GMT +9 Tokyo PGP/GPG: 4096R/6C6ACD6417B3ACB1