The link to download log4j is here. However I have logged into the my EC2 instance. Whats the command line to download this log4j ?

2 Answers 2


Try using wget to download the file:

wget http://www.eu.apache.org/dist/logging/log4j/1.2.17/log4j-1.2.17.tar.gz

You can change the eu to us in the URL to use the US mirror.

Also, consider using your package manager to install log4j instead; unless you have a specific requirement to download and install manually.

You've not mentioned which Linux distro you're running, but I know lib4j is available on Ubuntu and RedHat/CentOS.

For Ubuntu:

$ sudo apt-get install log4j

For RedHat/CentOS:

$ sudo yum install log4j

Change log4j to log4j-manual and/or log4j-javadoc in the commands above for the developer manual and API documentation respectively.


For Ubuntu, the package name is liblog4j2-java, so to install it using apt-get would be:

$ sudo apt-get install liblog4j2-java

For RedHat/CentOS as said in other answers would be:

$ sudo yum install log4j

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.