Executer une commande depuis un fichier java
Fermé
TheoReb
-
12 mai 2021 à 10:42
KX Messages postés 16668 Date d'inscription samedi 31 mai 2008 Statut Modérateur Dernière intervention 17 mars 2023 - 12 mai 2021 à 13:35
KX Messages postés 16668 Date d'inscription samedi 31 mai 2008 Statut Modérateur Dernière intervention 17 mars 2023 - 12 mai 2021 à 13:35
A voir également:
- Executer une commande depuis un fichier java
- Fichier rar - Guide
- Ce programme est écrit en python. il construit un mot secret dans une variable mais il ne l'affiche pas. modifiez-le pour qu'il affiche le mot secret. exécutez-le. quel est ce mot secret ? ✓ - Forum Python
- Fichier host - Guide
- Fichier iso - Guide
- Invite de commande - Guide
1 réponse
KX
Messages postés
16668
Date d'inscription
samedi 31 mai 2008
Statut
Modérateur
Dernière intervention
17 mars 2023
3 005
12 mai 2021 à 13:35
12 mai 2021 à 13:35
Bonjour,
Tu dois utiliser Runtime.exec
Voir la documentation :
https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Runtime.html
Exemple :
Tu dois utiliser Runtime.exec
Voir la documentation :
https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Runtime.html
Exemple :
public static void main(final String[] args) throws Exception {
Runtime.getRuntime().exec("java -jar monjeu.jar");
}