java - Find file in external jar not in my classpath -
i´m running test , need path of file it´s in jar lib have in project dependency.
this jar not part of classpath run.
if try like
val path = getclass.getresource("h2-1.3.161.jar").getpath
in test not work.
any idea how find file inside jar without jar part of classpath?
regards.
using solution of astrograph manage route
java -cp //file:/d:/users/nb38tv/workspace/f2e-core/f2e-mock/f2e-test-framework/target/f2e-test-framework-1.8.3-snapshot.jar!/h2/sakila-h2-master/h2-1.3.161.jar -ifexists -tcp -web -tcpallowothers
but java complain since cannot find jar.
if remove !
path receive error
unrecognized option: -ifexists error: not create java virtual machine. error: fatal exception has occurred. program exit.
any idea?
regards
is file .class file? can open file in test? can instantiate class jar file?
to location of class can use following method: system.out.println(this.getclass().getprotectiondomain().getcodesource().getlocation().touri().getpath());
Comments
Post a Comment