bug Thread sous eclipse mais pas sous intelij
Bonsoir,
J.aurai besoins d.etre aide sur un bug sur mon projet.
Lorsque je test mon programme sous intellij il fonctionne sans probleme.
Lorsque je le compil en .jar , il fonctionne mais la je ne peu peu pas bouge la fenetre ni utilise la fonction lie a ma dll. (Ce bug apparais depuis l.ajout de la dll, sa dépendances et une nouvelle fonction) sinon avant tout fonctionnais bien. Donc je suppose un projet d'ajout de la dll ou dependances.
Ce j'ai fait, j.ai essaye sous eclipse de travailler mon projet. j.ai mieux reussi a importe le projet avec mes dependances, dll et tout ce qu.il faut mais la aussi je rencontre un bug mais qui ne ressemble en rien a celui rien intellij.
La je ne peu meme pas lance le projet, il me donne un bug :
Code:
1 2 3 4 5 6 7 8 9 10
| Exception in thread "JNativeHook Dispatch Thread" java.lang.Error: Unresolved compilation problems:
CHOIX1 cannot be resolved to a variable
SIZE1 cannot be resolved to a variable
at main.norecoil.KeyBoardListener.nativeKeyPressed(KeyBoardListener.java:27)
at org.jnativehook.GlobalScreen$EventDispatchTask.processKeyEvent(Unknown Source)
at org.jnativehook.GlobalScreen$EventDispatchTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748) |
J'ai essaye aussi avec mon projet de base sous eclipse, sans ma dll et c'est dernier ajout (c'est a dire mon projet fonctionnel sous intellij et deja teste en .jar sur plusieurs machine) et pareil le meme bug.
Auriez vous une petite idée?
Merci
Cordialement
Fred
code ou se situe l'erreur
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
| import org.jnativehook.GlobalScreen;
import org.jnativehook.NativeHookException;
import org.jnativehook.keyboard.NativeKeyEvent;
import org.jnativehook.keyboard.NativeKeyListener;
import static main.norecoil.Main.Choix.CHOIX1;
import static main.norecoil.Main.Size.SIZE1;
public class KeyBoardListener implements NativeKeyListener {
public void nativeKeyTyped(NativeKeyEvent e) {
}
public void nativeKeyPressed(NativeKeyEvent e) {
if (e.getKeyCode() == NativeKeyEvent.VC_F9 ) {
Main.rapideFire = !Main.rapideFire;
}
if (e.getKeyCode() == NativeKeyEvent.VC_1) {
ConfigManager1.getInstance1().cycleConfigs();
}
if (e.getKeyCode() == NativeKeyEvent.VC_F7) {
Main.choix = Main.choix.next(CHOIX1);
}
if (e.getKeyCode() == NativeKeyEvent.VC_2) {
ConfigManager2.getInstance2().cycleConfigs();
}
if (e.getKeyCode() == NativeKeyEvent.VC_F8) {
switch(Main.armes) {
case ARMES1:
Main.memoireChoix.put(ConfigManager1.getInstance1().getCurrentConfig(),Main.choix);
break;
case ARMES2:
Main.memoireChoix.put(ConfigManager2.getInstance2().getCurrentConfig(),Main.choix);
break;
}
Main.armes = Main.armes.next ();
switch(Main.armes) {
case ARMES1:
Main.choix = Main.memoireChoix.getOrDefault(ConfigManager1.getInstance1().getCurrentConfig(),Main.Choix.CHOIX1);
break;
case ARMES2:
Main.choix = Main.memoireChoix.getOrDefault(ConfigManager2.getInstance2().getCurrentConfig(), Main.Choix.CHOIX1);
break;
}
}
if (e.getKeyCode() == NativeKeyEvent.VC_F11) {
Main.size = Main.size.next(SIZE1);
}
if (e.getKeyCode() == NativeKeyEvent.VC_F10) {
Main.Overlay = !Main.Overlay;
}
if (e.getKeyCode() == NativeKeyEvent.VC_F12) {
try {
GlobalScreen.unregisterNativeHook();
Main.enabled = false;
Main.shooting = false;
MouseListener.executorService.shutdown();
System.exit(1);
} catch (NativeHookException e1) {
e1.printStackTrace();
}
}
}
public void nativeKeyReleased(NativeKeyEvent e) {
}
} |