how to convert java project into java ee project - eclipse

I have a java project that contains a JFrame, I need to convert this project into eclipse for java ee project, and convert this JFrame into JApplet, so that I can easily embed the JApplet in jsp code. Please tell me how do I do it?
I am using:
Eclipse kepler standard for Java Project and Eclipse for Java EE developers for running an applet/webapplication.

Related

Java EE perspective in STS(Spring Tool Suite)

I'm using Spring Tool Suite(STS) and to run Java Servlets on Tomcat Server through STS I need Java EE perspective. But for me in list of perspectives in STS there is no Java EE perspective.
How do I get Java EE perspective in STS??
To get Java EE perspective in Spring Tool Suite(STS),
Go to Help > Eclipse Marketplace...
and search for Java EE
Search for the Eclipse Enterprise Java and Web Developers Tools
Now just install the Eclipse Enterprise Java and Web Developers Tools plugin and then your
list of perspective will look like this now

How can I chose a specific version of Java EE in Eclipse?

It's my first day with Java EE and I would like to understand:
How I can set up a Java EE 7 project? and where can I check what Java EE version I am actually using?
I downloaded the latest Eclipse for Java EE Developers (Neon) and am now trying to understand how all these parts fit together.
I ended up downloading Java Platform, Enterprise Edition 7 Web Profile SDK Update 3 as well as a Shell file to install Java Platform, Enterprise Edition 7 SDK Update 3.
I know there is a lot of instructions provided but I would just like to set up my Eclipse environment.
Happy for any help or resource!
You can follow this tutorial http://www.edu4java.com/en/servlet/servlet4.html it's old but it basically the same thing
You have to create a new project (Dynamic Web Project)
The versions of the Facets you choose will determine which Java EE spec version it aligns with
Choose your application server (I personally recommend Wildfly http://wildfly.org/, but the built-in Java EE Preview Server can run Servlets on its own)
And you are ready to go !

Adding Java EE sources to an Eclipse project

Using Eclipse, I have configured one Java EE project to include in its class path the JBoss 7.1 Runtime.
(I did this with the "Add Library" button in "Project properties" -> "Java build path" -> "Libraries").
I use Maven to build the project and "normally" this works fine.
However, when I debug this application the Java EE source classes are not available. Just in case I took a look in the JBoss runtime but apparently the sources are not there. My main question is: Could someone please tell me what is the best way to add the Java EE sources to my Eclipse project so they will be available when debugging?
Also, if I am working with Maven is fine to add the Java EE libraries as the JBoss Runtime, as I am currently doing in my project? or it is considered a better approach to declare the dependency on Java EE in the project POM instead?
I started to wonder if the JBoss runtime approach was the "correct" way to add the Java EE binary classes, since strangely enough Maven from time to time fails compiling the application since it cannot see anymore the Java EE classes. I solve this deleting the JBoss Runtime from the build path (in the Eclipse project configuration) and adding them again. Fortunately, this compilation does not happen often, so I have been able to work doing this workaround until now.
Thanks for any feedback.

ear-javaee6 archetype doesn't allow Java files

I created a new Maven Project and selected the org.codehaus.mojo.arhcetypes ear-javaee6 archetype. When I try to add a Java class to the project I get "Source folder is not a java project".
So we are not supposed to add Java classes to out .ear files now. What are these guys thinking when they create a project for a .ear but don't allow for Java classes?
What archetype should I use for creating Java EE 6 .ear files?
From Wikipedia, EAR (file format):
EAR (Enterprise Archive) is a file format used by Java EE for
packaging one or more modules into a single archive [...]
Create an EJB (ejb-javaee6 archetype) or WAR project (webapp-javaee6 archetype for example) for your java codes and refer to it from the Ear plugin configuration (and add as dependency too).

Which projects are on the list of JAVA EE Module Dependancy

I'm trying to include a project within another project as EE Dependency in Eclipse.
For some reason, the project I want to include is not displayed in the list of possible projects.
How does Eclipse decide which projects to use there?
Thanks!
WTP 1.5 (Eclipse 3.2+) introduced support for J2EE module dependencies for plain Java projects, external JARs, JARs in the workspace etc. This is controlled at the level of the Enterprise Application, rather than at the level of an EJB project or a Web Project.
Therefore, if you have a plain Java Project that you cannot add as a dependency to an EJB project, you can have this resolved by creating an Enterprise Application Project containing the EJB, and then adding the Java Project as a Java EE module dependency to the Enterprise Application. Once this is done, the Java Project is available as a Java EE module dependency for the EJB project.