Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2007

Tip: Looking for answers? Try searching our database.

J2EE install question

Thread view: 
Jim Bailey - 17 Apr 2007 14:41 GMT
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
Jim Bailey - 17 Apr 2007 15:38 GMT
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')

> 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
[quoted text clipped - 20 lines]
>
> jim in fl
Lew - 18 Apr 2007 01:31 GMT
> 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
[quoted text clipped - 3 lines]
> 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.)

Signature

Lew



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.