I know it's barely helpful, but this is so odd that you should do a complete rebuild of your workspace [Projects -> Clean... -> All projects].
Check whether you have errors in your build path [right-click a project -> Build Path -> Configure build path...], check for cyclic dependencies or missing JARs in all (parent) projects.
Further you should check whether you have exported a JAR and got that same JAR in your classpath somehow, causing the classes to be loaded from your JAR as opposed to the workspace.
Ramble ramble ramble.
- Clean didn't help...
- No errors in build path...
- I don't even know how to export as a JAR in Eclipse, so no...
@Riven The clean idea is the best course of action right now. Weird dependencies or missing JARs shouldn't affect anything really. Even if he has an older JAR, the newer class file should still be there in bin.
@theagentd
In the bin folder, can you find the OuterClas$Callback.class file inside its package folder?
1 2
| DebugPathfindingTick$Callback.class DebugPathfindingTick.class |
Yes, the class file is there.
The funniest thing just happened. If I call the exact same from another class it works. Turns out the problem is my custom security manager.
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
| private static class ScriptSecurityManager extends SecurityManager {
private static String ERROR_MESSAGE = "Script security error. Permission requested: "; private boolean security = false;
@Override public void checkPermission(Permission perm) { checkSecurity(perm); }
@Override public void checkPermission(Permission perm, Object context) { checkSecurity(perm); }
private void checkSecurity(Permission perm) { if (security && scriptThread == Thread.currentThread()) { throw new SecurityException(ERROR_MESSAGE + perm.toString()); } } }
public static void enableSecurity(){ scriptThread = Thread.currentThread(); securityManager.security = true; } public static void disableSecurity(){ securityManager.security = false; scriptThread = null; } |
If security = false, it works. If it's true, usage of inner/anonymous classes throw a NoClassDefFoundError.