Ejecutar el archivo jar en el símbolo del sistema [duplicar]


Posible Duplicado:
Cómo ejecutar un archivo JAR

¿Cómo ejecutamos un archivo jar en el símbolo del sistema?

 249
Author: Community, 2011-04-25

4 answers

Prueba esto

java -jar <jar-file-name>.jar
 430
Author: Bala R,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2011-04-25 03:46:33

Si no tienes un punto de entrada definido en tu manifiesto, invocar java -jar foo.jar no funcionará.

Use este comando si no tiene un manifiesto o para ejecutar una clase principal diferente a la especificada en el manifiesto:

java -cp foo.jar full.package.name.ClassName

Consulte también las instrucciones sobre cómo crear un manifiesto con un punto de entrada: https://docs.oracle.com/javase/tutorial/deployment/jar/appman.html

 222
Author: Lynch,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-04-29 03:00:17

java [any other JVM options you need to give it] -jar foo.jar

 31
Author: QuantumMechanic,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2011-04-25 03:46:52

Puede ejecutar un archivo JAR desde la línea de comandos de esta manera:

java -jar myJARFile.jar
 18
Author: icktoofay,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2011-04-25 03:46:31