Reputation: 3742
I am following a tutorial about Java EE - http://docs.oracle.com/javaee/5/tutorial/doc/bnaff.html
and when I deploy the netbean project with netbean and the bundled glassfish, it return error saying it cannot find java persistence.
Compiling 11 source files to E:\Raymond\Programming Practice\j2ee\javaeetutorial5\examples\web\bookstore\build\classes
E:\Raymond\Programming Practice\j2ee\javaeetutorial5\examples\web\bookstore\src\com\sun\bookstore\database\Book.java:13: package javax.persistence does not exist
import javax.persistence.Entity;
E:\Raymond\Programming Practice\j2ee\javaeetutorial5\examples\web\bookstore\src\com\sun\bookstore\database\Book.java:14: package javax.persistence does not exist
import javax.persistence.Id;
I realized that I might need to install java EE as I already have java SE6 in the machine.
But does Java EE include Java SE? I am trying not to create duplication.
If Java EE include Java SE, I would need to uninstall my Java SE then install the java EE.
If Java EE does not include Java SE, I should install Java EE seperately.
Upvotes: 2
Views: 2740
Reputation: 308763
Java EE is built on top of Java SE. Yes, you have to install it separately.
If you have Java SE 6 on your machine already, then you have what you need.
The class cited in the exception is a Java EE class. I'm guessing it means you've got a CLASSPATH issue. Add the persistence.jar to your CLASSPATH.
Upvotes: 4