J2EE install question

  • Follow


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.Thanksjim in fl
0
Reply Jim 4/17/2007 1:41:18 PM

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.javaDont know what the ':classes:.' is but took it out and it's fine (along with - there is no 'common' subfolder above 'lib')"Jim Bailey" <none@spam.com> wrote in message news:4624ceb1$0$9921$4c368faf@roadrunner.com...> 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>> 
0
Reply Jim 4/17/2007 2:38:49 PM


Jim Bailey wrote:
> 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.

>> 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

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

>> javax.servlet packages. 

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

>> So i downloaded the J2EE SDK 1.5 and it wants to 
>> install into a seperate directory structure. 

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.

>> Is this going to install the 1.5 runtime also ?

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

Is that the "this" you mean?

>> 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 ?

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.

>> 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. 

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

(Exercise: translate for Windows.)

-- 
Lew
0
Reply Lew 4/18/2007 12:31:32 AM

2 Replies
83 Views

(page loaded in 0.073 seconds)


Reply: