Skip to content

Instantly share code, notes, and snippets.

@mathieuancelin
Created February 9, 2012 13:01
Show Gist options
  • Save mathieuancelin/1779849 to your computer and use it in GitHub Desktop.
Save mathieuancelin/1779849 to your computer and use it in GitHub Desktop.
String myValue = "loser";
Field f = MyClass.class.getDeclaredField("jerem");
f.setAccessible(true);
f.set(null, myValue);
Copy link

ghost commented Feb 9, 2012

Error: could not access: java.lang.IllegalAccessException: Can not set static final int field VictimClass.USER_ID to java.lang.Integer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment