Ajouter un argument à la VM en cours d'execution
Fermé
speedzealot
Messages postés
18
Date d'inscription
vendredi 24 juillet 2015
Statut
Membre
Dernière intervention
17 novembre 2015
-
Modifié par speedzealot le 10/08/2015 à 15:56
speedzealot Messages postés 18 Date d'inscription vendredi 24 juillet 2015 Statut Membre Dernière intervention 17 novembre 2015 - 10 août 2015 à 17:31
speedzealot Messages postés 18 Date d'inscription vendredi 24 juillet 2015 Statut Membre Dernière intervention 17 novembre 2015 - 10 août 2015 à 17:31
A voir également:
- Ajouter un argument à la VM en cours d'execution
- Vm windows - Guide
- Panne tnt en cours aujourd'hui - Guide
- Ajouter un compte gmail - Guide
- En cours de livraison - Forum Consommation & Internet
- Impossible d'ajouter un ami sur facebook - Guide
1 réponse
speedzealot
Messages postés
18
Date d'inscription
vendredi 24 juillet 2015
Statut
Membre
Dernière intervention
17 novembre 2015
3
Modifié par speedzealot le 10/08/2015 à 16:14
Modifié par speedzealot le 10/08/2015 à 16:14
Ok c'est bon je l'ai :)
il est aussi dit que cela ne marcherai pas sur toutes les plateformes/JVM.
marche avec windows7 64 bits, jre7 32bits
Pour plus de details : https://stackoverflow.com/questions/5419039/is-djava-library-path-equivalent-to-system-setpropertyjava-library-path
public static void addLibPath(String s){ try { Field field = ClassLoader.class.getDeclaredField("usr_paths"); field.setAccessible(true); String[] paths = (String[])field.get(null); for (int i = 0; i < paths.length; i++) if (s.equals(paths[i])) return; String[] tmp = new String[paths.length+1]; System.arraycopy(paths, 0, tmp, 0, paths.length); tmp[paths.length] = s; field.set(null,tmp); System.setProperty("java.library.path", System.getProperty("java.library.path") + File.pathSeparator + s); } catch (IllegalAccessException e) { System.err.println("Failed to get permissions to set library path"); e.printStackTrace(); } catch (NoSuchFieldException e) { System.err.println("Failed to get field handle to set library path"); e.printStackTrace(); } }
il est aussi dit que cela ne marcherai pas sur toutes les plateformes/JVM.
marche avec windows7 64 bits, jre7 32bits
Pour plus de details : https://stackoverflow.com/questions/5419039/is-djava-library-path-equivalent-to-system-setpropertyjava-library-path
Modifié par speedzealot le 10/08/2015 à 18:05
ce qui m'amène à une question : peut-on creer une bibliothèque en cours d'execution (dans le main) ?