How to add/reference .jar files in your project when you don't have an IDE

后端 未结 2 1588
甜味超标
甜味超标 2021-01-18 04:23

I am new to Java (basically a LAMP developer). I got this JAVA API to parse .pst files and show all the inbox messages.

I tried executing a given

2条回答
  •  佛祖请我去吃肉
    2021-01-18 04:30

    You should put them on your classpath, like

    java -classpath someJar.jar YourMainClass

    And, of course, you can do the same for javac.

    If you need to have more than one jar or directory on your classpath, you'll need to use your platform's default path separator. For example, on Windows,

    java -classpath someJar.jar;myJar.jar YourMainClass

    On a side note, you might find it easier to use an IDE to manage this sort of stuff. I've personally used just my slightly scriptable editor and have managed fine. But it's good to know how to do this stuff by command line.

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