First of all, let me preface my questions by saying that I have tinkered with various versions of Linux over the years, but this is the first time that I've done anything like install j2ee on Linux. But, I've installed j2ee on several Win machines so I do have experience there. Having said all this, let's get on to the questions that I have.
1. This is more of a basic Linux question, but applies because of the situation. Do you have to uninstall j2ee from Linux if you want it to exist in another folder or can you just move it lock, stock and barrel?
2. As I stated, I've often installed j2ee on a Win machine, so I'm familiar with the necessary configurations that have to be set up in order for Java to run from anywhere; leading to this question. If I set up the JAVA_HOME and PATH correctly(which I have currently set in the etc/bash.bashrc file), should I be able to run ./javac and ./java from any location?
3. And question 2 leads to this question. Just where in the bash.bashrc do I set up the configuration variables? Most of what I've seen in the way of suggestions says to "append" the vars to the file, which to me implies the end. Is this a correct assumption on my part or have I missed something?
By the way, I'm running Ubuntu 7.10 and have the most recent version of J2EE.
Thanks for your help
Have you considered just using Apache and Tomcat? most linux distros can automatically install them.
Netbeans and Eclipse will make the war files from your java project with a click or two.
2) You need to set only PATH.
3) I use .bash_profile file to set up all variables.
Note that "J2EE" isn't a specific software package - it's just a specification, and there are several implementation of it. Sun's reference implementation is called Glassfish, and it's in the Ubuntu software repository, so the easiest way to install it on the command line is with the following command:
sudo apt-get install glassfish
If you want a different version of Glassfish than what's in the Ubuntu software repository, you can just download it from the Glassfish website and install it in whatever folder you like. If you are the only person who's going to use it on the computer, then you could install it in your own home directory. If it's a multi-user system, then a good place to install it is in /usr/local.
Sun provides an RPM for RedHat-style systems, but at last count no .deb. you should have no problems using alien, however. Their preference was to put all the JDKs and JVMs into the directory /usr/java. Oddly enough, this very manageable approach is something they only do on Linux - Solaris is less tidy.
Java is self-contained, so it's really sufficient to get one of the archives and copy it - the Sun RPM merely registers it in the database. It takes an "rpm --erase" command to remove all traces, including the database entry.
Java actually doesn't (unless I've missed something!) use either the PATH or JAVA_HOME. The PATH is convenient, because it keeps you from typing the absolute pathnames when executing Java and its utilities since your command shell will use it. JAVA_HOME is used as a convention by many products such as WebLogic and Tomcat, but Java itself doesn't need it.
For Java products such as Tomcat, the "proper" place and way to install is generally variable - I normally prefer /usr/local for them if they don't specify otherwise.
Red Hat has an extensive set of ancillary Java RPMs, but I've found it more trouble than simply managing the stuff myself - it's a little too granular for me. The "alternatives" system is even worse, as I've mentioned before.
I've digested all of the responses to my questions. Some of which I found helpful while others just lead me to more questions. Such is learning... right?
One of the things that I noticed from a lot of you was a questioning of my need for J2EE . I installed the J2EE + JDK package for Linux because I was under the impression that it was necessary to develop web applications, especially those utilizing EJB. Am I wrong? To clarify, here is my goal. I want to build a Linux machine that will allow we to locally build any type of web application that Java will allow/support with Tomcat as the servlet/jsp engine. So now you guys tell me... what is essential for making this happen?
One of the answers that I got referring to my first question brought up the subject of symbolic links. Does this imply that my installation of the J2EE package created a symbolic link to the location of the install? If that is the case, that would explain why the JAVA_HOME and PATH vars that I set up in the .bashrc file that point to the location where I moved my J2EE installation don't seem to work.
I appreciate all the answers that I received and I'm hoping that, with all of your help and a lot more reading on my part, that I get things ironed out and running.
One of the things that I noticed from a lot of you was a questioning of my need for J2EE .
It's because many people incorrectly assume that J2EE means EJB. In fact whole java web stack (servlets, JSP, JSF and WS) is part of J2EE.
I installed the J2EE + JDK package for Linux because I was under the impression that it was necessary to develop web applications, especially those utilizing EJB. Am I wrong?
no, of course not
To clarify, here is my goal. I want to build a Linux machine that will allow we to locally build any type of web application that Java will allow/support with Tomcat as the servlet/jsp engine. So now you guys tell me... what is essential for making this happen?
You can install and use NetBeans. It comes with Tomcat and Glassfish and everything works out of the box. No plugins required.
Originally posted by Dave Berkheimer:
I want to build a Linux machine that will allow we to locally build any type of web application that Java will allow/support with Tomcat as the servlet/jsp engine. So now you guys tell me... what is essential for making this happen?
There are many ways to do it.
I write web applications in Java with .jsp and servlets all the time. I do this all with the SE (standard edition) JDK, not the J2EE version. You can do huge numbers of great things with the SE version.
I generate code for Apache on Linux with Tomcat. Works great.
I do not do Enterprise Beans and all that heavy duty J2EE stuff.
I write it all in Netbeans, and debug it with the bundled Tomcat, downloaded from the Sun /java website in a bundle, and it all works great. I love being able to debug into servlets from Netbeans. Step in, set breakpoints, look at stuff, its wonderful.
I tend to believe, IMHO, etc. that J2EE was oversold and is overkill for a lot of professional development stuff. Its complex, and I like the Lighter Faster Java karma
YMMV, of course