Setting the classpath for JAR files

后端 未结 2 1687
予麋鹿
予麋鹿 2021-01-12 17:44

I have recently just created Java project using Eclipse that requires 2 JAR files (phiget21.jar and the mysql.jar)

Everything works fine when running the programme i

2条回答
  •  一向
    一向 (楼主)
    2021-01-12 18:21

    You need something like

    java -classpath lib/foo.jar:. com.company.Program
    

    you can also use wildcards since java 6. see here

    so the above becomes

    java -classpath lib/*:. com.company.Program
    

自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题