black sensei
black sensei

Reputation: 6678

Javax package and simple java application with spring hibernate

in my attempt to learn a bit faster the use of spring and hibernate i read few chapter on books and created a simple java project from netbeans 6.7. I've decided to use the hibernate annotations instead of mapping files.so in my pojo i import javax.persistence.*; and i have an error that javax doesn't exist.what sound surprising to me.is it because it's a simple java application? i come from .Net background and the main idea about this mini project is to consume (DAOs) it as i would use a class library project in .Net.How to solve or i would just have to create another project type. if yes which one? thanks for reading.

Upvotes: 1

Views: 878

Answers (3)

Michael Wiles
Michael Wiles

Reputation: 21194

You can probably add the persistence dependency via some artifact/facet that you need to set on the project. It should be there already, just have to find it.

But if you don't get anywhere, just google for persistence.jar (that's the name for the interface definitions of JPA).

Upvotes: 0

aberrant80
aberrant80

Reputation: 13017

Which edition of NetBeans did you install? Did you install the one with Java Web and EE support? The Java Persistence API is part of Java EE, so the standard Java SE installation won't have the necessary libraries packaged.

Upvotes: 1

akf
akf

Reputation: 39495

This sounds like a classpath issue. are you adding the jar with javax.persistence to your classpath

Upvotes: 1

Related Questions