J2EE install question

J

Jim Bailey

I've been learning Java with the J2SE SDK 6 and the Head First Java book and
all is fine. I'm now moving on now, using Head FirstServlets and JSP book,
and have installed Tomcat and all was fine first couple chapters, until I
realized I need to install J2EE as the compiler couldn't find javax.servlet
packages. So i downloaded the J2EE SDK 1.5 and it wants to install into a
seperate directory structure. Before i continue I have a couple questions
that I don't find explained anywhere that could maybe save me frustration
later.

Is this going to install the 1.5 runtime also ?
Am I going to need to change (add to) my classpath settings ? (I also was
using Netbeans before starting the new book)
Is this going to screw up my Tomcat install since it's going to want to
install Sun's App Server ?

Basically, am I heading down the right path ? I already had to reinstall
Tomcat to get rid of that 'Apache Software Foundation\....\.....' directory
structure - too much typing to get anything done. I'm looking for 'do this
now, so you don't have to live with the headache later' type of tips.

Thanks

jim in fl
 
J

Jim Bailey

Sorry for the bad etiquette replying to myself but wanted to stop folks from
taking time to reply.

I found the problem - simply a bad command line in the book. The classes
are there in Tomcat without installing J2EE.

book:
javac -verbose -classpath
c:\Tomcat6.0\common\lib\servlet-api.jar:classes:. -d classes
src\com\example\web\BeerSelect.java

Dont know what the ':classes:.' is but took it out and it's fine (along
with - there is no 'common' subfolder above 'lib')
 
L

Lew

Jim said:
Sorry for the bad etiquette replying to myself but wanted to stop folks from
taking time to reply.

I will take the time anyway. Please do not top-post.
I found the problem - simply a bad command line in the book. The classes
are there in Tomcat without installing J2EE.

Tomcat /is/ JEE, or part of JEE, anyhow.
book:
javac -verbose -classpath
c:\Tomcat6.0\common\lib\servlet-api.jar:classes:. -d classes
src\com\example\web\BeerSelect.java

Dont know what the ':classes:.' is but took it out and it's fine (along
with - there is no 'common' subfolder above 'lib')

'classes' is the second element of the classpath, a relative directory
classes/ in the current working directory (cwd). '.' is the cwd, also in the
classpath. ':' is path-separator-char for Unices. (Extra credit: What is the
path separator char for Windows? Hint: Examine the PATH envar.)

If you installed Tomcat correctly, there is supposed to be a common/lib/
folder in its program tree. It's rather necessary to Tomcat so it really
shouldn't be missing.

Nonsense. If you installed Tomcat correctly you do not need to install an
additional JEE container.

In servlet-api.jar, in the Tomcat distribution, in common/lib/, in fact.

Because it's a separate product. Not to worry, Tomcat already installed
servlet-api.jar and jsp-api.jar, among others, in its common/lib/ folder.
That's why you want it in your classpath for compilation, only the folder
should'nt be in the classpath, the individual JARs should be.

No, at least not if by "this" you mean installing the two JEE products.

Is that the "this" you mean?

The two are separate products. As long as you either have them listen to
different ports or only run them one at a time you'll be fine.

export
CATALINA_HOME=/usr/lib/ApacheSoftwareFoundation/reallylongdirectory/pathto/tomcat
PATH=$CATALINA_HOME:$PATH
cd $CATALINA_HOME

(Exercise: translate for Windows.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,262
Messages
2,571,052
Members
48,769
Latest member
Clifft

Latest Threads

Top