J2EE installation help

X

xarora

Hello,

I had j2se and j2re already installed on my system (windows xp).

Now I downloaded j2EE1.4 with Sun Application Server 8.1 pack. So, it
is an all in one bundle which comes with j2se 5 and j2ee 1.4 sdk , sun
application server, point base database server etc.
I downloaded that from here
http://java.sun.com/j2ee/1.4/download.html#sdk

I am using JCreator LE version IDE for java development. And it has
been working perfectly fine.

Anyway, after downloading J2EE, I made a simple file Monkey.java (and
it uses packages import javax.servlet.* etc) But it won't compile. It
keeps giving me error that package javax.servlet.* not found.

I am told that to write servlet programs, you need to download J2EE
(and I already did that!) What did I do wrong ?

Help would be greatly appreciated.

Thanks.
 
P

Pete Barrett

Hello,

I had j2se and j2re already installed on my system (windows xp).

Now I downloaded j2EE1.4 with Sun Application Server 8.1 pack. So, it
is an all in one bundle which comes with j2se 5 and j2ee 1.4 sdk , sun
application server, point base database server etc.
I downloaded that from here
http://java.sun.com/j2ee/1.4/download.html#sdk

I am using JCreator LE version IDE for java development. And it has
been working perfectly fine.

Anyway, after downloading J2EE, I made a simple file Monkey.java (and
it uses packages import javax.servlet.* etc) But it won't compile. It
keeps giving me error that package javax.servlet.* not found.

I am told that to write servlet programs, you need to download J2EE
(and I already did that!) What did I do wrong ?
If you're doing wrong the same thing that I did wrong when I first
tried to use the Sun Application server, the problem is that the
compiler can't find the JARs with javax.servlet in them. They're all
tucked away inside the Sun Application server directory tree somewhere
(I've forgotten where, but it will be in a lib directory somewhere -
you'll have to have a look), and JCreator can't find them. I don't
know JCreatro, so don't know how you tell it where to look, but I
expect you know that.

Pete Barrett
 
E

E.Otter

Installing the j2EE1.4 with Sun Application Server does not update the PC's
classpath/bootclasspath with the j2ee-specific jar's. As far as I know,
none of the j2ee app servers do this. When the app server is running, it
loads the j2ee-specific jar files into its own memory space so any
servlet/jsp/whatever that is run by the app server will be able to find
them. But that doesn't help you compile Monkey.java. What you need to do
is add/change the CLASSPATH environment variable to include each and every
j2ee jar files you want to compile with. I'm not familiar with Sun's App
Server, its directory structure, what jar files you would need, or even what
kind of computer you are compiling on, so I can say do xyz to change your
classpath... I would recommend you read the documentation to find out what
jar's contain which files and where they are located in the install
directory.

E.Otter
 
?

.

If you're doing wrong the same thing that I did wrong when I first
tried to use the Sun Application server, the problem is that the
compiler can't find the JARs with javax.servlet in them. They're all
tucked away inside the Sun Application server directory tree somewhere
(I've forgotten where, but it will be in a lib directory somewhere -
you'll have to have a look), and JCreator can't find them. I don't
know JCreatro, so don't know how you tell it where to look, but I
expect you know that.

The file Pete is referring to is in C:\Sun\AppServer\lib. The j2ee.jar
files contains the javax.servlet.* classes. You can either copy these jar
files to your J2SE lib directory or you might be able to add the
AppServer\lib path to your CLASSPATH in JCreator.
 
C

carora

Thanks everyone. I found j2ee.jar under Sun\AppServer\Lib .. Thanks
again.

As a followup queston: Now my Monkey.java compiles and results into
Monkey.class - how do I run(deploy) this on Sun App Server ? Do I need
to create some xml file or something ?

Thanks.
 
X

xarora

Thanks everyone. I found j2ee.jar under Sun\AppServer\Lib .. Thanks
again.


As a followup queston: Now my Monkey.java compiles and results into
Monkey.class - how do I run(deploy) this on Sun App Server ? Do I need
to create some xml file or something ?


Thanks.
 
P

Pete Barrett

Thanks everyone. I found j2ee.jar under Sun\AppServer\Lib .. Thanks
again.


As a followup queston: Now my Monkey.java compiles and results into
Monkey.class - how do I run(deploy) this on Sun App Server ? Do I need
to create some xml file or something ?
The Sun App Server comes with its own DeployTool, which (if you can
understand the instructions, which are not very clear in my opinion,
but once you've worked out how to do it it's quite easy) will put
everything into the correct type of file for you and even put it on
the App Server correctly.

Pete Barrett
 

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

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top