# Installing and Building JacORB

> ## Content

> - Prerequisites
> - Installation
> - Building JacORB (optional)

> ### Prerequisites

> - JDK 1.4 or later
> - Version 1.5 or later of the Jakarta Ant build tool, available from http://jakarta.apache.org/ant.
> - for IIOP over SSL:

>   JDK 1.4, or the IAIK cryptography provider and SSL implementation, available from http://www.iaik.at

> - for using names instead of ip adresses in IORs:

>   Either use JDK1.4 or use dnsjava 1.1.6 (or above) available from http://www.xbill.org/dnsjava. See step 7 for instructions.

> This release has been tested on:

> - Linux JDK 1.4.2
> - Solaris JDK 1.4.2
> - Windows 2000 JDK 1.4.2_01,
> - Windows NT JDK 1.4.1

> ## Installation

> 1. recommended:
>    Download "Ant" and install as described in its documentation (needed to build the demos and if you want to rebuild JacORB.)
> 2. Extend your search path to include the `/bin` subdirectory of the installation directory so that the JacORB utilities can be found.
> 3. If you can't or don't want to use the `jaco[.bat]` start scripts, copy `orb.properties` to `JAVA_HOME/lib` or edit the existing `orb.properties` file.
> 4. Edit `jacorb.properties` and copy them to your "home" directory. Please use jacorb_properties.template as a template. Most options need no configuration, but make sure you adjust at last the URL strings for the services you plan to use (e.g. NameService and so on) to match your domain's web server or local file system structure. Please consult the programming guide's section on setting up the name server for details. The trader and the implementation repository are located using the same mechanism. If you don't need these services, just comment out the corresponding line in the properties file.

>    Also, you can configure how much diagnostic information JacORB emits by setting the jacorb.log.default.verbosity property. A value of 0 means no output, level 1 emits basic connection information, and levels 2 and above are debug levels.

>    NOTE: If you are updating from an existing JacORB installation you MUST change existing jacorb.properties files to reflect the changes in package names (the leading "org.") where property values point to JacORB classes. E.g., the value for property:

>    `org.omg.PortableInterceptor.ORBInitializerClass.standard_init`
>    must be changed to:

>    `org.jacorb.orb.standardInterceptors.IORInterceptorInitializer`

> 5. Generate or edit the start scripts jaco and jaco.bat: (This step is carried out automatically by the build process, so it is only required if you are not rebuilding JacORB.)
>    1. If you have Ant installed, simply call "ant jaco"
>    2. If you don't have Ant, you need to create and adapt the jaco[.bat] script in bin yourself to update the classpath. You can use the file jacotemplate[.bat] as a template and replace the @@@XYZ_HOME@@@ placeholders by your actual paths.

>       You will also need to replace the @@@CLASSPATH@@@ tokens with appropriate values:
>       `-Djava.endorsed.dirs=${JACORB_HOME}/lib \
>       -classpath ${JACORB_HOME}/lib/jacorb.jar:\
>       ${JACORB_HOME}/lib/logkit-1.2.jar:\
>       ${JACORB_HOME}/lib/avalon-framework-4.1.5.jar:\
>       ${JACORB_HOME}/lib/concurrent-1.3.2.jar:\
>       ${JACORB_HOME}/lib/antlr-2.7.2.jar
>       `

> 6. Generate or edit the IDL compiler scripts idl and idl.bat if you plan to use the IDL compiler. (This step is carried out automatically by the build process, so it is only required if you are not rebuilding JacORB.)
>    1. If you have Ant installed, simply call `ant idlcmd`
>    2. If you don't have Ant, you need to create and adapt the idl[.bat] script in bin yourself to update the classpath. You can use the file idltemplate[.bat] as a template and replace the @@@XYZ_HOME@@@ placeholders by your actual paths.
> 7. If you prefer host names instead of IP addresses in your IORs you have to install dnsjava (make its classes present) and recompile `src/org/jacorb/orb/dns`. To recompile, do an "ant" in that dir, and an "ant libs" in the JacORB root dir. If you're absolutely sure that you're not using the jacorb.jar, you can omit rebuilding the libs.

>    If the IP addresses aren't resolved properly at all, see the dnsjava docs on how to set properties to tell dnsjava where to look for the DNS servers.

>    ## Building JacORB (Optional)

>    Ensure that Ant (See version requirements above) is installed on your system and that you are starting with a clean environment. The easiest way to start is with your CLASSPATH unset. If CLASSPATH is set to anything, it must contain `${installdir}/lib/logkit-1.2.jar`!

>    N.B. Windows users should ensure that JacORB is installed in a path that does not contain spaces. Errors will be encountered building the Notification Service otherwise.

>    To build JacORB you need to call "ant" in the installation directory:

>    `$> ant`

>    By default debugging is turned off when building JacORB. To build JacORB with debugging turned on, you need to call "ant -Ddebug=on" in the installation directory:

>    `$> ant -Ddebug=on`

>    Under Ant1.5 and above the debuglevel may also be set e.g.

>    `$> ant -Ddebug=on -Ddebuglevel=lines,source,vars`

>    ### NOTES:

>    The build process may abort, claiming that javac does not have enough memory. This can happen when trying to compile a large number of files at one time. To avoid this on Unix, copy the file "ANTRC" to your home directory renaming it to ".antrc". If you are building on a Windows platform copy the antrc_pre.bat file to your home directory (as denoted by %HOME%). ant will consult these files and use a larger Java maximum heap size. If this is not applicable in your setting you need to edit ANT_HOME/bin/ant(.bat) such that the java interpreter is passed the -mx48m (or whatever) switch.

>    For Windows add the following line after calling `antrc_pre.bat`

>    `set ANT_OPTS=-mx48m %ANT_OPTS%`

>    For Unix add the following line after sourcing .antrc

>    `ANT_OPTS=-mx48m $ANT_OPTS`

>    Yet another way of achieving the same is by setting the ANT_OPTS environment variable. On Windows:
>    `set ANT_OPTS=-mx48m`
>    or on Unix:
>    `export ANT_OPTS=-mx48m`

>    ## Building JacORB Examples (Optional)

>    To build the JacORB demos within the demo directory a build.xml file has been supplied. Similar to above, simply call "ant" in the demo directory. The default Ant target will build all the demos. The classes will be placed in

>    `${installdir}/classes`

>    By default debugging is turned off. See above for instructions on this.

Gerald Brose, May 2004.