Required software

  • J2SDK 1.4.2 from http://java.sun.com (required).
  • Maven 1.0.2 from http://maven.apache.org (required).
  • A Java web server (only one required), such as:

    • Tomcat 5+ (default) from http://jakarta.apache.org/tomcat.

      Edit TOMCAT_HOME/conf/tomcat-users.xml to add:

      <role rolename="manager"/>
      <user username="manager" password="manager" roles="admin,manager"/>
                                  

      Edit TOMCAT_HOME/bin/catalina.sh so that JAVA_OPTS has a default maximum heap of 512mb (-Xmx512m) and allows remote debugging (-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8787)

    • JBoss Application Server 4.0.3+ from http://www.jboss.com.

      After installation copy JBOSS_HOME/server/default to JBOSS_HOME/server/javacareers-default.

      Edit JBOSS_HOME/bin/run.conf and JBOSS_HOME/bin/run.bat so that JAVA_OPTS has a default maximum heap of 512mb (-Xmx512m) and allows remote debugging (-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8787).

      Remove the directory JBOSS_HOME/server/javacareers-default/deploy/jbossweb-tomcat55.sar/jsf-libs if it exists or you 'll get a ClassCastException between Sun's JSF and MyFaces. If you have already started your server once, also delete data, log, tmp, work from JBOSS_HOME/server/javacareers-default/deploy/jbossweb-tomcat55.sar before starting your server.

    • Resin 3+ from http://www.caucho.com.
  • A database server (only one required), such as:

    • Hypersonic (default) which is embedded in the application. No need to seperatly install it.
    • MySQL 4+ from http://www.mysql.org.

      On Windows, configure a custom detailed MySQL configuration. Select as character set support for multilingualism (UTF-8). Give the root user the username root and the password root. The default table type will be InnoDB. Leave all other settings as the default. Start MySQL with MYSQL_HOME/bin/mysqld

      On Linux the RPM creates a default configuration with a root and anonymous user with no password. Change their passwords with:

      MYSQL_HOME/bin/mysql -u root -p
      SET PASSWORD FOR 'root'@localhost = PASSWORD('root');
      SET PASSWORD FOR ''@localhost = PASSWORD('anonymous');
      exit
                                  

      On Linux the default table type will probably be MyISAM which doesn't support transactions. Create the file /etc/my.cnf with the contents:

      [mysqld]
      default-table-type=InnoDB
                                  

      After the checkout of the project in the next section of this guide, create the database javacareers with the #/javacareers-serviceimpl/src/sql/createDb.sql script from the command line:

      MYSQL_HOME/bin/mysql -u root -p < #/javacareers-serviceimpl/src/sql/createDb.sql
                                  

      You can also do this with the MySQL query browser.

  • A Java IDE, such as:

SourceForge (SF) setup

  1. If you don't have a SF account, create a new account at http://www.sf.net.
  2. Subscribe yourself to the JavaCareers developer's mailing list.
  3. Although it is not required, it is recommended to use a secure protocol to work with CVS, etc.

    1. Generate a public and private key pair with Putty's keygen or Cygwin's open-ssh.
    2. Log in into SF and go to my sf.net/account options/[Edit SSH Keys for Shell/CVS].
    3. Open the public key file on hard drive, copy-paste the contents into the website form and submit it.

Build setup

  1. Checkout the project javacareers from version control (CVS) under your SF username. It's recommended to use a secure protocol (ssh, ext). We 'll refer to the checkout directory as #/.
  2. Copy #/globalmavenconfig/example.build.properties to the local file #/globalmavenconfig/build.properties. Edit build.properties and set your username, application server, database and other local settings. That file will be ignored for version control. Any properties in this build.properties can also be overwritten in USER_HOME/build.properties.
  3. In the directory #/ run maven javacareers:build. The project should build.
  4. Start up your webserver. In the directory #/ run maven javacareers:cleanBuildDeploy. Take a look at http://localhost:8080/javacareers-webclient.

IntelliJ setup

  1. In the directory #/ run maven javacareers:idea. Note that if you haven't run maven javacareers:build yet this goal will fail.
  2. Open #/javacareers.ipr as a new project.
  3. Set File/Settings/Project/Verion Control to CVS.
  4. If you're using JBoss, open File/Settings/IDE/Plugins and install the JBoss plugin. Open File/Settings/IDE/Application servers and configure your JBoss instance. Open File/Settings/Project/Paths/javacareers-webclient/Web module settings, select JBoss as an application server and edit the JBoss Web DD to point to #/javacareers-webclient/src/web/WEB-INF/jboss-web.xml (default it doesn't have src/web). Open Run/Edit configurations.../JBoss server and add a local configuration to start your server instance javacareers-default, but do not deploy javacareers-webclient. Always deploy the war with maven. Open Run/Edit configurations.../Remote and add a configuration to host localhost and port 8787 for remote debugging.
  5. To make life easier you can configure #/build.xml as an ant build. It's just a wrapper around the maven build. Open the ANT Build properties/Execution and select the correct JDK.

Eclipse setup

Eclipse 3.0.x does not support the structure of a maven multiproject all that well. Project directories cannot overlap.

You need to checkout the project javacareers from CVS (not just a subdirectory of it) but that directory should become the workspace and its subdirectories should become subprojects. Use WinCVS, maven or the cvs command line to checkout the project, but do not use Eclipse.

  1. Create a new workspace from the directory #/.
  2. In the directory #/ run maven javacareers:eclipse. Note that if you haven't run maven javacareers:build yet this goal will fail.
  3. Import each of .project files from the subdirectories of #/ as an existing project. For example: #/globalmavenconfig/.project

Netbeans setup

Maven integration modules are available for Netbeans 4.0 and 4.1. They can be downloaded at http://mevenide.codehaus.org/mevenide-netbeans-project/index.html. Install these modules through the Netbeans Update Center under the "tools" menu context. Choose "Install Manually Downloaded Modules" and browse to the previously downloaded modules.

After installation Netbeans will want to reboot.

You need to checkout the project javacareers from CVS (not just a subdirectory of it) but that directory should become the workspace and its subdirectories should become subprojects. You can do this with Netbeans' built-in CVS support under the "Version" menu context.

Netbeans will prompt you to supply the necessary CVS repository information as well as commandline cvs- and ssh client. Note: on MS Windows you can use WinCVS- and TortoiseCVS' cvs.exe. Plink.exe or TortoisePlink.exe can be used as an ssh client.

All that is left for you to do is to open the newly checked out project. It already is a Netbeans project so no need to create a new one.

OPTIONAL: If you are feeling adventurous you could try installing the JBoss integration module from the beta update server. If not you can start the server seperately.