adds a java state