Skip to content

Build SANDAG Jar

Wu Sun edited this page Oct 6, 2021 · 10 revisions

This section describes the process to build SANDAG jar file (sandag_abm.jar) and is divided in the following sub-sections:

Software Requirements

Eclipse

  • Go to https://www.eclipse.org/downloads/ and download Eclipse 2019-06. File: eclipse-inst-win64.exe (52.0 MB)
  • During installation choose "Eclipse IDE for Java Developers" and follow instructions to complete the installation
  • After finish, launch Eclipse. Set workspace to your desired directory or keep it to default.

Maven

Java Developers Kit (jdk1.8.0_221 64-bit version)

Pip

Instructions are available at https://phoenixnap.com/kb/install-pip-windows

  • Check if you already have pip. On a command prompt run: pip --version
  • If an error then pip is not installed and would need to be installed
    • download "get-pip.py" from here: https://bootstrap.pypa.io/get-pip.py
    • open command prompt as administrator
    • navigate to the get download directory and run: python get-pip.py
    • try pip --version on a newly opened command prompt
    • if pip is still not found. Then you have to mare sure that your environment variables are set correctly. Double check "Set Environment Variables" steps.

Microsoft Visual C++ Compiler Package for Python 2.7 (needed to install py2exe)

py2exe (python 2.7)

Instructions are available here: https://stackoverflow.com/questions/23734172/install-py2exe-for-python-2-7-over-pip-this-package-requires-python-3-3-or-late

Git (optional)

Instructions are available here: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git

TortoiseGit (optional)

Environment Variables

Set environment variable to python install - python 2.7.15

  • Open system properties --> Advanced System Settings --> Environment variables.. --> Select PATH under "System Variables" --> Click Edit and add your python installation path at the end of it, ex. C:\Program Files\Python27
  • under system variables
    • New --> PY_HOME = C:\Program Files\Python27
    • Again, new --> PYTHONPATH = %PY_HOME%\Lib;%PY_HOME%\DLLs;%PY_HOME%\Lib\lib-tk;C:\another-library
    • click on "PATH" and then "Edit.."
    • Click on "New" and add "%PY_HOME%
    • Again, click on "New" and add "%PY_HOME%\Scripts"
    • Click OK on all windows

Build Jar

  • Create a Local Git Repository

    • Download SANDAG GitHub repository from here: https://github.com/SANDAG/ABM
    • You can use git and tortoise git and clone the directory to your local machine
    • Clone the desired branch, ex. "ABM2_TRUNK"
  • Open eclipse

    • Import Local Git Repository
      • File --> import --> Git --> Projects from Git --> Existing local repository --> Add the cloned SANDAG ABM repository and finish.
      • Import --> import as general project
      • Keep default project name
    • Convert to Maven project.
      • Open Package Explorer
      • Right click on the project and go to configure--> convert to Maven
      • Will take some time so be patient
    • Make sure JRE is set to JDK 1.8.0_221
      • Right click on the project --> Properties --> Java Build Path
      • If JRE System Library (jdk1.8.0_221) is not present under Libraries then click on "Add Library..."
      • Choose "JRE System Library and click "Next >"
      • If Workspace default JRE is "jdk1.8.0.221" click Finish
      • Else select "Alternate JRE" and select "jdk1.8.0.221" from drop down.
      • If not present in drop down, click on "Installed JREs..."
      • Click "Add...", choose JRE Type as "Standard VM"
      • For "JRE Home", click on "Directory..." and Select your jdk installation directory (ex. C:\Program Files\Java\jdk1.8.0_221)
      • Click "Finish"
      • Bring you back to "Installed JREs" window, Select the just added jdk under installed JREs and click "Apply and Close"
      • Bring you back to "Add Library" window. Double check that the aded jdk is selected for "Alternate JRE"
      • Click "Finish"
      • Bring you back to Properties window. Click "Apply and Close"
  • Build a Maven Project

    • Connect to SANDAG VPN (required to download Maven dependencies)
    • Right click on the maven project under package explorer
    • Choose Run As --> 4 Maven build... (sometimes it is 5 Maven build...)
    • Under the "Edit Configuration" window
      • Set the following under the tab "JRE"
        • Make sure Runtime JRE is set to jdk1.8
        • If not, select the jdk1.8 under "Alternate JRE:"
      • Set the following under the tab "Main"
        • Goals: clean package
        • Profiles: 2016
        • Base Directory must be already set to your project
        • User settings must be already set to settings.xml under your local user directory
        • Click "Run"
  • This should results in a successful build. The build files are stored here: {project_directory}\target\SANDAG CT-RAMP Activity Based Model\version_14_2_0

If build fails, contact Wu.Sun@sandag.org for support.

Clone this wiki locally