Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compiling my first java program for JSP

Status
Not open for further replies.

oaklandar

Technical User
Feb 12, 2004
246
US
I am new to JSP and have Tomcat 4.1.27 loaded on my workstation with j2sdk1.4.1.

It works and I am able to create my first "Hello World" page but now trying to create a simple class and bean and compile it. I am not sure about where my local web server classpath is located and what I need to do?

Here is my local url:
and the path looks like this on my Windows 2000 workstation:
C:\jakarta-tomcat-4.1.27\webapps\ROOT\first.jsp

Where do I put my "HelloWorld" class? Can I put it in my ROOT folder?
Afterwhich how do I compile it to use it as a bean?
I tried putting a HelloWorld.java class in my ROOT folder and compiling it in DOS in the ROOT folder such as: javac HelloWorld.java
and it says: 'javac' is not recognized as internal or external command.

Please advise because I am trying to write my first bean and make it work with a simple "HelloWorld" output.
 
I'm also at the same stage as you.

Here's what I've done:

Java installation directory is c:\j2sdk1.4.2_02.

Then (if you're running Windows), I updated the PATH System Variable with c:\j2sdk1.4.2_02\bin.

You should then be able to save your .java codes under any special directory under C:\.

Then wherever you save your .jsp, just import the class.

Hope this helps. If you have more questions, then please provide all of your paths and install directories.

scripter73


Change Your Thinking, Change Your Life.
 
Not sure on how to update my Path system variables.

Here are my directories on my Windows 2000 local workstation where I am trying to get this to work.

Code:
C:\j2sdk1.4.1_02

C:\jakarta-tomcat-4.1.27

Please advise. Thanks
 
set JAVA_HOME=C:\j2sdk1.4.1_02
set PATH=%JAVA_HOME%\bin;%PATH%
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top