Changing Java Architecture on Servers

Originally Wiki'd By: Brad Galla 23-Aug-2013 09:34 CDT

There are certain cases where it would be necessary to request more memory than an application can demand in a 32-bit address space, so it may be necessary to convert to a 64-bit address space. Luckily there is a way to perform this modification, and ensure your AnthillPro instance will operate smoothly. The following section lists how to convert to a 64-bit architecture:

Prerequisites

You need to make sure the following already apply before even attempting to convert the server to a 64-bit architecture of Java:

  • The server file-structure is backed up. If filesize is of concern, please make sure the following directories are (at least) backed up:
    • %SERVER_HOME%\bin
    • %SERVER_HOME%\bin\service
    • %SERVER_HOME%\conf\
  • A 64-bit distro. of Java has been installed somewhere on the filesystem.
  • Check if Windows Services are installed. If so, you need to follow these directions after you have completed the file system changes.
  • (OPTIONAL): Backup the Windows Registry if Windows Services are Installed

Changes to Server File System

Once a 64-bit architecture of Java is installed, you can update the AnthillPro server to use the new Java. To do this, you will need to make the following modifications:

  1. Ensure the server is shutdown before any modifications are made!
  2. Edit the ah3server.cmd file in the %SERVER_HOME%\bin directory and change the following sections:
    1. Update JAVA_HOME to point to the new location
  3. Edit the classpath.conf file:
    1. Update nativedir to use the x64 instead of the x86 directory.
    2. Change the tools.jar location to use the new Java installation's location.
    3. A screenshot that shows the changes between an old classpath.conf file and a new one
      A screenshot that shows the changes between an old classpath.conf file and a new one
  4. Edit the installed.properties file in the %SERVER_HOME%\conf\server directory and change:
    1. Update the install.java.home to use the new location. REMEMBER TO ESCAPE YOUR ENTRIES!
    2. A screenshot that shows the changes between an old installed.properties file and a new one
      A screenshot that shows the changes between an old installed.properties file and a new one
  5. Start the AnthillPro server.

Note on Windows Services

If for some odd reason you have installed your AnthillPro server as a Windows Service instead of running it from the command prompt, you will need to modify the following as well BEFORE starting the server up after making the above changes:

File System Changes

  1. Edit the _ah3server.cmd file in the %SERVER_HOME%\bin\service directory and change:
    1. Update the set ARCH line to say x64 instead of x86.
  2. Edit the ah3server.cmd file in the %SERVER_HOME%\bin\service directory and change:
    1. Update the set ARCH line to say x64 instead of x86.
  3. Reinstall the service (next section)

Windows Registry Changes

From an Administrative Command Prompt navigate to the %SERVER_HOME%\bin\service directory and run the following:

  1. ah3server remove <old service name>
  2. ah3server install <new service name>

This will install a new Windows Service with the correct values in the registry that you provided earlier in this article.

Note on Thread Dumps

See this link for important information regarding thread dumps from Windows Services.