java - Bat file set classpath -
can see wrong below code? it's bat file , i'm trying set dependency classes before executing jar (jdbc oracle driver).
set classpath=lib\dbdriver.zip;%classpath% java -jar sql2java.jar test.properties pause
i class not found exception (the class in zip i'm trying add in classpath). tried executing admin, no avail
set classpath=lib\dbdriver.zip;%classpath% java -jar %~dp0sql2java.jar %~dp0test.properties pause
the class inside zip file (path \oracle\jdbc\oracledriver) , i'm trying retrieve
jdbc.driver=oracle.jdbc.driver.oracledriver
check doc java
(java application launcher).
for -jar
option says -
executes program encapsulated in jar file. first argument name of jar file instead of startup class name. option work, manifest of jar file must contain line in form main-class: classname. here, classname identifies class public static void main(string[] args) method serves application's starting point.
when use option, jar file source of user classes, , other user class path settings ignored.
so either need package in jar (sql2java.jar
) or don't use -jar
option java
launcher command.
Comments
Post a Comment