How to run a class from a jar with from command-line with classpath specified

后端 未结 2 1927
盖世英雄少女心
盖世英雄少女心 2021-01-22 09:04

I am trying to run a class from a JAR. This class is NOT the only main class in this jar. Also, it requires number of other jar files, which I have kept in the same directory as

2条回答
  •  执念已碎
    2021-01-22 09:43

    try:

    java -cp C:\temp\test_myProj\mysql-connector-java-5.1.13-bin.jar;myProjImport.jar com.mycomp.myProj.importer.csv.TestImporter "C:\Documents and Settings\user\workspace\myProjImport\src\conf\datasource.properties" "C:\temp\apollo_claims_test.txt"

    provided your running this from the same direcotry as myProjImport.jar

提交回复
热议问题