Windows 分解多类路径
我只是试图从命令行执行liquibase update,但找不到任何方法为Windows 分解多类路径,windows,classpath,liquibase,Windows,Classpath,Liquibase,我只是试图从命令行执行liquibase update,但找不到任何方法为--classpath参数传递多个路径。我使用的命令如下: liquibase.bat \ --driver=oracle.jdbc.driver.OracleDriver \ --classpath="C:/Users/Me/path_to_driver/ojdbc7.jar" \ --changeLogFile="C:/Users/Me/path_to_changelog_file/
--classpath
参数传递多个路径。我使用的命令如下:
liquibase.bat \
--driver=oracle.jdbc.driver.OracleDriver \
--classpath="C:/Users/Me/path_to_driver/ojdbc7.jar" \
--changeLogFile="C:/Users/Me/path_to_changelog_file/changelog.xml" \
--url="jdbc:oracle:thin:@db_host:1521:xe" \
--username=user_name \
--password=some_pass \
update
可以将一个或多个路径添加到
--classpath
?我需要向变更集文件添加路径,并且我正在使用Windows。--classpath=path:anotherPath
应该可以工作您需要什么类路径?你的liquibase.bat里有什么?如果您正在执行某种java程序,请尝试使用帮助中的-classpath=classpath迁移文件和JDBC驱动程序中的java-cp liquibase.integration.commandline.Main[参数]
。如何同时指向ojdbc jar和变更集目录?您是否尝试使用
作为类路径分隔符?如果我使用类似于“some_path;C:/Users/username/path_to_ojdbc/ojdbc7.jar”
的语法,那么我会得到:运行Liquibase时出现意外错误:意外值C:/Users/username/path_to_ojdbc/ojdbc7.jar:参数必须以“---”开头
。如果我使用像“some_path”这样的语法;“C:/Users/username/path_to_ojdbc/ojdbc7.jar”
然后我得到类似于:ojdbc7.jar:第1行:$'PK\003\004':未找到命令ojdbc7.jar:第2行:▒^▒D:未找到命令ojdbc7.jar:第44行:意外标记附近的语法错误
$'▒K▒\034z“\t▒我▒0▒▒Y.`好吧,我认为--classpath
应该是唯一的jdbc驱动程序或war | ear | jar
,其中包含jdbc驱动程序和迁移文件(如果您查看源代码,可能会发现更多)但是你可以按照我在第一条评论中的建议去做——把你的变更日志放到系统类路径java-cp
上,把jdbcdriver放到--classpath
上。参数--includeSystemClasspath
应该起作用,因为它会从系统类路径加载变更日志。