简体   繁体   中英

Create a Jar library for a web application with Netbeans

I want to create a JAR library that will be shared among different web projects.
This library will contain the @Entity classes for the projects that access to the same database structure.
I tried creating "Java class Library". But when I try to add an annotation javax.persistence.Entity i realize that this (annotation) class is not available in my project. Probably because the project is a "standard edition" project.
So my questions are:
1) the difference between SE and EE is just the libraries loaded or there is some sort of switch triggered somewhere?
2) where is, in Netbeans, the corresponding project targeted to the EE platform?

You simply need to add the required jars to the build path. javax.persistence can be used in a java SE project, it's just not there in netbeans automatically.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM