Navigation Bar

Sunday, October 25, 2009

Java and Tomcat Installation Steps

 



     



You can change the install directory


Java is successfully installed.

Java is installed. No separate exe to install the jre is required.
Set the environment variables JAVA_HOME and PATH


If the PATH and JAVA_HOME environment variables are set correctly , you can verify the same by typing "java" and javac" on the cmd prompt.

The java command give you the usage and options for running the jave command to execute a class or a jar file.
E:\install\tomcat\tomcat11013\webapps\httpreqresp>java
Usage: java [options]  [args...]
           (to execute a class)
   or  java [options] -jar  [args...]
           (to execute a jar file)
   or  java [options] -m [/] [args...]
       java [options] --module [/] [args...]
           (to execute the main class in a module)
   or  java [options]  [args]
           (to execute a single source-file program)

 Arguments following the main class, source file, -jar ,
 -m or --module / are passed as the arguments to
 main class.

 where options include:

    -cp 
    -classpath 
    --class-path 
                  A ; separated list of directories, JAR archives,
                  and ZIP archives to search for class files.
    -p 
    --module-path ...
                  A ; separated list of elements, each element is a file path
                  to a module or a directory containing modules. Each module is either
                  a modular JAR or an exploded-module directory.
    --upgrade-module-path ...
                  A ; separated list of elements, each element is a file path
....
....
....
The javac command gives the usage and options for compiling a .java file
E:\install\tomcat\tomcat11013\webapps\httpreqresp>javac
Usage: javac  
where possible options include:
  @                  Read options and filenames from file
  -Akey[=value]                Options to pass to annotation processors
  --add-modules (,)*
        Root modules to resolve in addition to the initial modules,
        or all modules on the module path if  is ALL-MODULE-PATH.
  --boot-class-path , -bootclasspath 
        Override location of bootstrap class files
  --class-path , -classpath , -cp 
        Specify where to find user class files and annotation processors
  -d                Specify where to place generated class files
  -deprecation
        Output source locations where deprecated APIs are used
  --enable-preview
        Enable preview language features.
        To be used in conjunction with either -source or --release.
  -encoding          Specify character encoding used by source files
  -endorseddirs          Override location of endorsed standards path
  -extdirs               Override location of installed extensions
  -g                           Generate all debugging info
  -g:{lines,vars,source}       Generate only some debugging info
  -g:none                      Generate no debugging info
  -h 
        Specify where to place generated native header files
....
....
....
Now download and extract the tomcat installation to a suitable path say E:\install\tomcat\tomcat11013
CATALINA_HOME=E:\install\tomcat\tomcat11013
Execute the startup.bat from <CATALINA_HOME>/bin folder


At the end you will see a line 

org.apache.catalina.startup.Catalina.start Server startup in [1805] milliseconds
It means your server is up and running. You can test it on the browser url of any suitable web browser like microsoft edge or chrome, you can type the following
http://localhost:8080/examples/jsp/
And you should see the commonly tomact jsp example page


Thats all there is to setting up a web server using Java. You are now ready to develop and run any web application on this environment


God's Word for the day
Happy are those who do not blunder with their lips
  and need not suffer remorse for their sin.
Happy are those whose hearts do not condemn them,
  and who have not given up their hope.
Sirach 14:1-2

Concerning Treasures 
Do not store up for yourselves treasures on earth
  Where moth and rust consume and where thieves break in and steal
But store for yourselves treasures in heaven
  Where neither moth nor rust consumes and where thieves do not break in and steal.
For where your treasure is, there your heart will be also.
Mathew 6:19-21

No comments:

Post a Comment