Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

94
Vistas
How can I check the version number of Log4j in a .jar file?

I have a .jar project which may be using Log4j. How can I check the version number of that Log4j?

It's an executable JAR file. I don't have the source code and can't decompile it.

over 4 years ago · Santiago Trujillo
6 Respuestas
Responde la pregunta

0

Decompress the JAR file and look for the manifest file (META-INF\MANIFEST.MF)

unzip -p file.jar META-INF/MANIFEST.MF
over 4 years ago · Santiago Trujillo Denunciar

0

org.apache.log4j.Layout.class.getPackage().getImplementationVersion()
over 4 years ago · Santiago Trujillo Denunciar

0

If you have sudo shell access to the server or host, you can get quick and dirty answers with this or something like it:

sudo find / -name "*log4j*" -print -exec unzip -p {} META-INF/MANIFEST.MF \;

As mentioned in other answers this won't work for all JAR files, but it seemed to for me.

over 4 years ago · Santiago Trujillo Denunciar

0

Decompress the JAR file of your application and check version in the pom.xml/property file present in directory "META-INF\maven\org.apache.logging.log4j\log4j-core"

over 4 years ago · Santiago Trujillo Denunciar

0

If you are on Linux, this can help. It looks for Log4j JAR files, extracts the manifest files of them and prints the Implementation-Version: line which will show you the version of Log4j.

locs=( $(sudo find / -name 'log4j*'|grep jar) )
fcount=${#locs[@]}

echo "Found $fcount jar files"
echo " "

for (( j=0; j<${fcount}; j++ ));
do
   unzip ${locs[$j]} META-INF/MANIFEST.MF
   mv META-INF/MANIFEST.MF META-INF/MANIFEST$j.MF
done

echo " "
for (( j=0; j<${fcount}; j++ ));
do
    echo ${locs[$j]}
    tail -2 META-INF/MANIFEST$j.MF
done
over 4 years ago · Santiago Trujillo Denunciar

0

There are two ways to do this

Way 1:

jar -tfv my.jar | grep -i log4

  23590 Tue Aug 10 10:51:24 IST 2021 log4j-slf4j-impl-2.13.3.jar
  32722 Tue Aug 10 10:51:24 IST 2021 log4j-web-2.13.3.jar
1714164 Tue Aug 10 10:51:24 IST 2021 log4j-core-2.13.3.jar
  23702 Tue Aug 10 10:51:24 IST 2021 log4j-over-slf4j-1.7.30.jar
 292301 Tue Aug 10 10:51:24 IST 2021 log4j-api-2.13.3.jar
  11259 Tue Aug 10 10:50:10 IST 2021 log4j2.xml

Way 2:

unzip -l my.jar | grep -i log4

    23590  08-10-2021 10:51   log4j-slf4j-impl-2.13.3.jar
    32722  08-10-2021 10:51   log4j-web-2.13.3.jar
  1714164  08-10-2021 10:51   log4j-core-2.13.3.jar
    23702  08-10-2021 10:51   log4j-over-slf4j-1.7.30.jar
   292301  08-10-2021 10:51   log4j-api-2.13.3.jar
    11259  08-10-2021 10:50   log4j2.xml
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda