Profile wont matched with graph cache in version 9.0

No, not really. Btw, what are you trying to do? You could read your profiles from config.yml, even when you want to use the Java API.