Setup Java EE environment on Mac - java

I am new to Java EE. I want to setup Java EE environment to begin developing web applications. I read through articles on internet but they seems to be confusing. My question is that is there any one time installer for Java EE development environment setup? I mean like we have for PHP is that WAMP, XMPP, LAMP etc.

There is no single installer, but two will be enough - you will need an IDE - the most popular are Eclipse and NetBeans. And you will need a Java EE distribution which comes in the form of a Java EE compliant application server - the most popular ones are JBoss and Glassfish. With both IDE and server all you have to do is unpack them into folders of your choice.
The JavaEE distibution of NetBeans already includes GlassFish - even less to do for you ;)
As a prerequisite, you will need an installed JDK, a JRE won't do.
EDIT : In order to control the server and deploy from eclipse you will have to tell it where your application server is - there are according plugins for Glassfish and for JBoss.
I'm not sure about JBoss integration with NetBeans - never done it, but NB intagrates seamlessly with Glassfish.
Glassfish incldes a Derby (JavaDB) distribution, and JBoss includes a H2 DB distribution which both will be enough to start.
Using MySQL or other databases will require a bit of configuration, so if you're just starting - don't bother yet.

You might want to use Eclipse Juno Eclipse IDE for Java EE Developers,
http://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/junosr1

Related

Unable to create Java Web EE 7 project in Netbeans7.3.1

I am having a problem with Netbeans and when I tried to create a Java Web by following their instructions:
Choose File | New Project.
Under Categories, select Java Web.
Under Projects, select Web Application.
Click Next. Web Server-- Apache Tomcat 7.0.42
but Java EE version-is only EE6 and EE5. Why does it not Show EE7??
should i need to install any plugin?
I have the follwong installed:
JDK 1.7_upadte_42
Netbeans 7.3.1
Apache Tomcat 7.0.42
Tomcat is not a Java EE compliant application server to begin with, it is a servlet container1. It is clearly stated in the official site:
Apache Tomcat™ is an open source software implementation of the Java Servlet, JavaServer Pages, Java Expression Language and Java WebSocket technologies.
In order to use Java EE 7+ capabilities, you need to use a Java EE 7+ compliant server. Currently, AFAIK this is done by GlassFish 4 only. When you visit the official site, it is stated in the top: World's first Java EE 7 Application Server. Make sure you configure your project to use GlassFish 4 and then you may use Java EE 7 benefits for your applications.
Note that this is also covered in Netbeans 7.3.1 community news:
NetBeans IDE 7.3.1 is an update to NetBeans IDE 7.3 and includes the following highlights (emphasys mine):
Support for Java EE 7 development
Deployment to GlassFish 4 (not Tomcat)
Support for major Java EE 7 specifications: JSF 2.2, JPA 2.1, JAX-RS 2.0, WebSocket 1.0 and more
1 At least not until Tomcat 7. Looks like from Tomcat 8 it will support Java EE 7 profile (from the official site linked above):
The Apache Tomcat Project is proud to announce the next release candidate for Apache Tomcat 8 - 8.0.0-RC5 (alpha). Tomcat 8 is aligned with Java EE 7.
Short Answer: You need to use Tomcat 8+ for Java EE 7 web projects. Additionally (as mentioned), you may need to use a later version of NetBeans (7.4+) for full support.
Long Answer:
I'm a little late answering here, but I'm posting an answer for the record in case others see this question and to clear up misconceptions. Contrary to the prevailing belief, you can deploy Java EE apps to Tomcat.
There are two Java EE profiles relevant here: the "Full" profile (which includes the full Java EE stack) and the "Web" profile (a subset of the full profile which is designed to be implemented more easily by servlet containers). As mentioned, if you must use functionality only available in the full Java EE 7 profile you will need to deploy to an app server such as Glassfish 4+, [Jboss] Wildfly 8.1+, or JEUS 8.
However, Tomcat does comply with the Java EE Web profile, so you can deploy Java EE apps to it so long as you stick to just the functionality provided by the Web profile.* Often (if not usually) the web profile is all you need. The web project mentioned by the asker only uses stuff from the web profile. Tomcat 7 complies with the Java EE 6 Web profile and Tomcat 8 complies with the Java EE 7 Web profile, so the OP just needs to upgrade to Tomcat 8 if he wants to use EE 7.
* Oracle makes it easy to stick to one profile or another by distributing specific API jars for each profile ("javaee-api" for the full profile, "javaee-web-api" for the web profile, etc). That's the only dependency you need** to create Java EE apps, and you don't even have to (and shouldn't) bundle it in your WAR. In reality you may need to bundle (but not compile against) some libraries a la carte--or use the TomEE variant of Tomcat--to use all EE 7 web features.
** If you see gobbledygook about "endorsed dirs" and "endorsed APIs" in your build files, that's not a real dependency and is just to ensure that your code compiles against the correct class versions. For example, the standard (non-EE) Java 7 runtime already includes a version of JPA, but Java EE 7 includes a different version so the compiler needs to know which version to use. Don't take out that gobbledygook or you could (but probably won't) have runtime "class version incorrect" issues.
At the moment, Java EE 7 is only partially supported by Netbeans 7.3.1. They will support it in NB 8.0. Also, you need Tomcat 8 for Java EE 7, but their support is still partial too. Glassfish 4.0 is the way for now.
Here are some useful docs:
http://wiki.netbeans.org/JavaEE7
http://tomcat.apache.org/whichversion.html
http://docs.oracle.com/javaee/7/tutorial/doc/

Eclipse plugins for Java EE development

What it is the best combination for fast development Java EE projects in Eclipse.
What i try to get is
Fast application server start
Hot deploy in both web-app and ejb modules.
Editing jsp without server restart
I found out for myself that best choice when developing webapp application is using WTP for Eclipse with maven plugin.
It give me all feature of WTP and also provide with up-to-date building script, that can be used outside of Eclipse, and also it simplify jar management.
I'm looking for something similar when developing Java EE application. What is the best combination of Java EE server(should i use Jboss or Glassfish) and Eclipse plugins ?
WTP is completely sufficient:
it allows you to start and stop servers and redeploy applications (see the Servers view)
allows hot swap - i.e. replace the class on save (unless you have made structural changes) (just start the server in debug mode)
jsp pages can be edited without restart with default configuration of most servlet containers.

Recommendations for Test Linux/Web Server Environment using Java

I'm a .NET developer looking do some research on my own time to better familiarize myself with Linux and Java (e.g JSP and Servlets).
My plan is to install Linux on an old PC. Then, install and configure a web server capable of hosting JavaServer Pages and Servlets. I would like to create a small web site with dynamic content being pulled from a database. Again, this site is only intended to be used by me for research and testing.
I have very little experience with Linux and Java. Did a couple projects back in college, but that was over 8 years ago.
Below are the questions I have about configuring a test environment I can use for research and testing.
1) What version of Linux should I install on my old PC?
2) What web server should I install on my Linux machine that can be used to host JavaServer Pages and Servlets?
3) What database should I install on the Linux machine? Since I'm doing this for research, it would be nice to test with a DBMS that is commonly used in the real world.
Thanks,
Chris.
You can use Debian, Tomcat and MySQL.
Debian is a fairly common linux distribution and will work on almost every PC.
Tomcat is a simple servlet container. It's the best choice if the only thing you want to do is servlets and JSP.
MySQL is, well MySQL :)
If you do mind using Linux, you can use Ubuntu which is more user-friendly but not really recommended as a server (at least for the default version).
These applications/distributions are from the most used and with the most active communities.
Resources :
debian.org
tomcat.apache.org
mysql.com
ubuntu.com
Whichever you want :-) At work, for example, our Linux servers run Red Hat Enterprise Linux, which is loosely based on Fedora, so that might be a good distribution to use that might be similar to what you would experience in the 'real world'.
Tomcat or JBoss Application Server would be good app servers to start with. Tomcat is just a servlet container, whereas JBoss supports more of the Java EE technologies. That said, many organisations find that a 'lightweight' app server like Tomcat is perfectly adequate.
MySQL and PostgreSQL are both widely-used open source database servers.
I would install the latest Ubuntu. The most user friendly and should work on your old PC.
I would install Glassfish or JBoss. Glassfish comes with Oracle's Java EE and is the easiest to install. JBoss is more widely used in commercial settings. Better yet, install both and try it on both!
MySQL is easy to install on Linux machines. In fact it's usually installed by default by the distribution.
Good luck! Linux is a great learning experience and a lot of fun!
I'm not a specialist in linux distributions, but as webserver the apache tomcat would be the best choice, I think version 6. The database may be a mysql, but for professional usage with more functionality postgresql will be the best choice.
Slackware. You will get lots of different answers on what distribution to use, and a lot of it is personal preference. I always prefer Slackware for server installations, and install all my software from source. I think of Ubuntu and Redhat more as client/desktop installations. I don't like to rely on packages to keep my servers up-to-date.
Tomcat. You don't need J2EE. Tomcat will do the job nicely.
MySQL. It's quite standard and works well.
1) As you want, but I suggest you a Red-Hat (CentOs for example) or Debian (Ubuntu for example) based distribution. With respectively Yum/RPMs and Aptitude/Synaptic, it will be easier to install Java (even if it is not difficult on other distributions).
2) To serve JSP pages and execute servlets, I suggest you Tomcat. It is much easier to install/configure it than other webservers (JBoss, Websphere, Weblogic, etc.), and you won't need them in a first time (EJB, etc.)
3) As a database, you can use MySQL (very easy to install), or PostgreSQL, or Oracle Express Edition (not Open Source but Free... And Oracle is very often used on big projects). From a Java point of view, it will be very similar (JDBC/Hibernate access to database "hide" the specificity of DB)
I think you are starting in the wrong place.
1.
If you want to try out linux try out linux. You don't need to install it - just download a "live CD". I believe the latest Ubuntu installer comes on a live cd.
2.
If you want to try out java web development you don't need to set up a server just install eclipse for java ee and create a dynamic web project. Then just start developing. Try to find some tutorials, etc. Eclipse can even download a development tomcat from within the ide.
3.
For databases - why not just use the same database you use with .net? I am sure there will be a jdbc driver and the code you write shouldn't be that different from any other database.

Best Java EE server for ColdFusion

What is the best Java EE server to deploy coldfusion 9 on? I know there is Tomcat but i'm sure there are others.
The ColdFusion support matrix lists a limited number of Java EE servers that they support:
WebLogic Server 9.2, 10.3
WebSphere Application Server ND 6.1, ND 7
JRun Updater 7
JBoss 4.2, 5.01
Your choice from this list is going to be dictated by commercial realities, not technical ones - WebLogic and Websphere are the leading servers, but commercial (and expensive); JBoss is free (although you can pay for a support contract); JRun is just rubbish, and I suspect only supported because if I remember correctly, JRun and ColdFusion used to be the same platform.
Having said all that, CF may run just fine on any other appserver, but that would be unsupported.
You need to answer two or three questions to decide:
Do you know enough about it to not
want to just use JRun?
Which Java EE servers do you know well
enough to support (or know the best)?
Which of those are on the supported
servers list?
If you can deploy Cold Fusion on any Java EE app server, there are lots to choose from:
WebLogic
JBOSS
Glassfish
Jetty
WebSphere
Pick the one that fits your budget.
I've listed these in my order of preference. I think WebLogic is still the best Java EE app server out there. Let's hope Oracle doesn't kill it.
I built a ColdFusion 6.1 application for a national 401k provider deployed on JBoss and it worked very well. Actually, I was able to run CF 6 on a 64-bit JVM because I was no longer hindered by JRun.

Hot Deploy for JBoss on Eclipse 3.4: Ganymede

I am using Ganymede (Eclipse 3.4) to do some Java EE based web development targeting a JBoss 4.2 application server.
I have always liked Eclipse very much for a Java editor. The thing is, for Java EE is not as useful as one might think. It's buggy, deployment and debugging is very slow, and you have to re-deploy your Java EE application every time you make a little change. That makes development unbearable.
My question is: Is there a plugin that will make my life easier by adding HOT DEPLOY to Ganymede when developing JBoss Applications?
Yes, you can use JBoss tools:
http://www.jboss.org/tools
I've used this when developing on JBoss using Eclipse 3.4, it works well although there are still some bugs in the plugin. Overall though it's better.
Update site for 3.4.2 is:
http://download.jboss.org/jbosstools/updates/stable/
EDIT: Also, if you're running on Redhat you can download JBoss Developer Studio which is "guaranteed" to provide a development environment that is stable and deployable. I've not used it, but interested to see whether it lives up to those claims:
http://www.jboss.com/products/devstudio/
You can do this out of the box with remote debugging. Connect the Eclipse debugger to JBoss and when you make a code change it will be hot-patched where possible.
There's a tutorial on doing so here

Categories

Resources