java - How can I add a .jar file dependencies when building it with the command line tool? -


pretty straightforward question. can done without use of ants or maven? (and that, mean command line tool specifically)

please notice don't want create uberjar, want archived unit "know" external dependencies are.

presuming you're talking command line invocation of javac, you're talking "can provide libraries arguments javac fulfill requirements during compilation".

top entry man javac says

   -classpath classpath           sets  user class path, overriding user class path in           classpath environment variable.  if neither classpath or -class-           path   specified, user class path consists of current           directory.  see setting class path more details. 

effectively suspect need say

javac -classpath path/to/library1.jar main.java


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -