I recently received a macbook pro.
I wanted to to learn java,jsp and develop some sample web applications in my local machine.
Can anyone provide me a specific link where I can perform the following on my Mac Os to get started:
Install Java
Install an IDE.
set up tomcat
Tutorial for creating learning sample program that contains java,jsp
connect to a local db and test it out in my local web browser.
I know there are lot of different instructions in the web, i would appreciate if some of the experts here point me to the best way to get started .
Will already be installed on a mac
I would suggest either IntelliJ or Eclipse as two examples of good Java IDEs. Both have very good support for developing web applications in Java. The IDE question is probably never ending, so it's really a case of what works for you.
For Tomcat you can't beat these instructions.
Each framework has its own instructions. Perhaps start with Spring or Play! for java
Related
I want to start a JavaEE project, I've read about where to start with JavaEE and most of them were directed to Glassfish. I installed it, and was able to get to the localhost, however I don't know where to go next. Is there a complete guide or tutorial on how to use Glassfish? Also if I can use MySQL with Glassfish for the JavaEE project.
Of course, you can use MySQL. You can find a complete guide for setting up a connection with MySQL for Glassfish here.
An IDE like Netbeans is probably the easiest way to get started with JavaEE. You only need to add your freshly installed Glassfish server to Servers (under Services tab), then you can start working on your project.
However, it may be advisable not to use IDE at the beginning, since it hides from you some essential operations. Therefore, you'd better start by making your first 'test' project manually (I mean building and deploying).
There are several books for beginners to JavaEE platform and they usually start with a decent introduction on how to accomplish that. For example this one covers the topic in details:
Beginning Database-Driven Application Development in Java EE by Yuli Vasiliev.
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.
There is a lot of information about Java around, but I don't understand how to setup everything.
I have a Mac. I heard the JDK comes with Macs. But is it the latest? How do I check that? Is it the J2SE or J2EE?
I want to create a web app. I installed NetBeans. When I choose create project there is a list of Java options. There is Java/Java EE/Java FX/Java Web. Which one should i choose? and afterwards, what is what? What is War?
I want to find a good tutorial/ebook explaining all these Java terms and how to setup Java/Java Server(Glassfish/Tomcat) on a Mac and with NetBeans to code a web app? A good one!
The netbeans tutorials can be found here: http://netbeans.org/kb/trails/java-se.html
To start off, just make a plain Java project. The other types all probably include different plugins or libraries that you won't need right away. A WAR is an archive of Java classes and other files that constitutes a web application.
The default version of the JDK that you have on your Mac should be fine, but if you want to upgrade or mess around with any other Java preferences, OS X offers all that for you. Apple has a good tutorial here: http://developer.apple.com/java/faq/
Edit: Ok, if you want to make a web app then the first step is to learn how a Java web app is organized. That will make your life much easier. Java EE is mostly a buzzword (IMO) and it refers to a specific set of libraries. It's not important to know what's officially considered Java EE and what isn't. To learn about what a Java web app looks like, the best place is the Tomcat manual. Read this section, then make a WAR project in Netbeans and you should have a good start. Don't try to bite off too much at first, just make a Hello, World! app.
An excellent resource for learning Java development is Java Passion.
There you can learn basic Java development, and the Java EE tutorials will also get you started developing web applications.
Here are some links on how to setup Tomcat / Glassfish for Mac OS X.
Tomcat on OS X
Glassfish on OS X
Trying to go straight into Java Enterprise Development is going to be too steep a learning curve unless you already know Java. Take a step back, and start going through some Java Tutorials.
It will likely be a while before you can tackle Java EE (it can be a monster).
I love eclipse and java. And i want to code my entire web application using eclipse .. right from designing html files to servlets.. I have zero experience in developing web apps .. So How to to setup eclipse for web apps and How do i get started ???
Google even autocompletes this question so you know it's a popular query!
There is very little information that you are providing, and there are actually tutorials for creating web applications with Eclipse and Java. You will want the JavaEE version of Eclipse as a starting point.
If you want to try using a web framework that works with Java I recommend Struts, although this may be too big if you're wanting to develop small web applications (and it's not exactly the easiest thing to start with).
I also recommend installing Apache Tomcat as your server because it's free and easy to use. Here's a good starting tutorial:
http://www.xwt.org/tutorial/eclipse/
Firstly, make sure you've got the Java EE eclipse binary : http://www.eclipse.org/downloads/
As has been mentioned, there are various google-able tutorials on how to set up, deploy and manage web applications under eclipse.
I am fairly comfortable with standalone Java app development, but will soon be working on a project using a Java EE application server.
Does anyone know of a straightforward how-to tutorial to getting a hello-world type application working in an application server? I'm (perhaps naievly) assuming that the overall approach is similar between different frameworks, so I'm more interested in finding out the approach rather than getting bogged down in differences between the different frameworks.
If you are not aware of a good guide, then could you post bullet-point type steps to getting a hello-world running?, i.e.
Download XX
Write some code to do YY
Change file ZZ
Other steps...
Note: Just because I have a windows machine at home, I would prefer to run if this could be run on windows, but in the interest of a better answer, linux/mac based implementations are welcome.
I would choose JBoss AS or GlassFish for a start. However I'm not sure what you mean by Java EE "Hello World". If you just want to deploy some JSP you could use this tutorial (for JBoss):
http://www.centerkey.com/jboss/
If you want to get further and do the EJB stack and/or deploy an ear-file, you could read the very good JBoss documentation:
Installation Guide
Getting started
Configuration Guide
In general you could also just do the basic installation and change or try the pre-installed example applications.
I currently have JBoss installed (on windows). I develop with Eclipse and use the Java EE server integration to hot deploy or debug my code. After you get your first code running you realy should have a look at the ide integration since it makes development/deploy roundtrips so much faster.
The JavaEE (they dropped the 2) space is pretty big. A good tutorial to start is the one from Sun. For a simple hello world application, the web container only would suffice. A well known servlet jsp container is tomcat. See here for installation instructions. Try installing it with eclipse and create a web project. This will generate some files for you that you can look at and edit. Also starting and stopping the application server is simpler.
Another option is to get Oracle JDeveloper (free to download and use - it's a full featured IDE that includes some neat extras like the SQL workbench and BPEL designer).
As a learning tool, it is quite good, not only for the tutorials available from Oracle, but it includes a range of "cue-card" lessons in the tool itself to teach many common techniques.
cue card view http://tardate.heroku.com/images/jdev-cuecards.jpg
If you haven't gone near NetBeans in a while its catching up with Eclipse very fast and worth a look, especially when starting Java EE.
Version 6.x installs Tomcat and/or Glassfish for you and then provides wizards to create/deploy/redeploy applications.
The initial tutorial on Web Applications is here and a more complex example here.
As JeroenWyseur puts it, Java EE is a fairly big space. In addition to what he said, you should try to get more details of what exactly you'll be doing: servelts & co, EJB (entity, session, message beans?) and try to get familiar with that.
It should be clear for you that your code runs in a managed environment, which imposes a lot of constraints. in order to make sure you understand what happens you should get familiar with the concept of deployment. Then, if you do EJBs, transaction management is important too. If you don't understand exactly what happens when a bean or a servlet is deployed, how transactions are managed, how beans are invoked, you're going to have a hard time.
A book that helped me a lot back in the time is Mastering EJB, by Ed Roman.
Also, getting familiar with RMI will help you understand EJBs.