[javac] C:\Hibernate\helloworld_JPA\src\persistance\Hiber nateUtil.java:11: cannot access org.hibernate.cfg.AnnotationConfiguration [javac] bad class file: C:\Hibernate\helloworld_JPA\lib\hibernate-annotations.jar(org/hibernate/cfg/AnnotationConfiguration.class) [javac] class file has wrong version 49.0, should be 48.0 [javac] Please remove or make sure it appears in the correct subdirectory of the classpath. [javac] sessionFactory=new AnnotationConfiguration().con figure().buildSessionFactory(); [javac] ^ [javac] 19 errors
I got the point that lines like @Entity ,@GeneratedValue using 1.5 coding,right?
Yes. You can't use annotations with a JDK lower than 5.0.
Then why is that error with AnnotationConfiguration file?
hibernate-annotations.jar contains classes compiled by a 5.0 compiler. When you try to use them with a 1.4 compiler the compiler spots that the class version if higher than it supports and compilation fails. So to fix your problem, use JDK 5.0.