restFB AccessToken cannot be resolved to a type

1k Views Asked by At

I am using restfb-1.6.12 and having a little trouble with the error "AccessToken cannot be resolved to a type" when using the following code:

import com.restfb.DefaultFacebookClient;
import com.restfb.FacebookClient;

AccessToken accessToken = new DefaultFacebookClient().obtainAppAccessToken(MY_APP_ID, MY_APP_SECRET);
out.println("My application access token: " + accessToken);

I have the restfb-1.6.12.jar located in the WEB-INF\lib folder and I have the com.restfb classes folder located in WEB-INF\classes.

1

There are 1 best solutions below

1
On

Add this import to your class file:

import com.restfb.FacebookClient.AccessToken;