Skip to content
Tags

Compile Java on command line and Include packages

6. September 2013

As I’m getting more and more a friend of pure commandline programming, I tried to compile a Java-file directly!
But this file has references to external classes, provided in *.jar files! What made me struggling a little bit!

Like always…Googling that helped a lot to find the answer!

So that’s the trick:


javac -cp '.:package_1.jar:package_2.jar' MyJavaFile.java

Notice: That works only on Linux systems

Advertisements

From → tutorial

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: