So you can use facebook4j without external configuration files. The code below gives a minimal example. Here is my simple demo:
import facebook4j.Facebook; import facebook4j.FacebookException; import facebook4j.FacebookFactory; import facebook4j.auth.AccessToken; public class Facebook4JMinimalExample { public static void main(String[] args) throws FacebookException {
Please note that it is important that FIRST makes a call to "facebook.setOAuthAppId (..)" and THEN sets the access token. Otherwise, you will get an IllegalStateException in which "OAuth app id / secret combination is not provided."
In this case, I just used the default value for OAuthAppId.
source share