Q:

How read an annotation file?

I dont'know that, how can I read a file. I would like to read the FK.java file, but give me a class not found exception. FK is annotation java file. (I have tried "src/annotations/FK.java" but didn't work.
private static String clazz = "src/annotations/FK";

public static List<Object> GetAnnotations() throws ClassNotFoundException{

    Class<?> c;
    c = Class.forName(clazz);

    List<Object> result = new ArrayList();

    Field[] fields = c.getDeclaredFields();
    for (int j = 0; j < fields.length; j++)
    {
        Annotation[] annot = fields[j].getAnnotations();
        for (int k = 0; k < annot.length; k++)
        {
            result.add(annot[k].annotationType());
        }
    }
    return result;
}

public static void main(String[] args) throws ClassNotFoundException {
    System.out.println(GetAnnotations());
}

A:

The name of the class should contain dots (.) not slashes ('/')
private static String clazz = "annotations.FK";

Then
Class.forName(clazz);

will try to load the class annotations/FK.class from the provided classpath.  If you only have the .java file, you will need to compile it first.
EDIT: fixed path based on comments

