Σοφία Installation Instructions

Use of Σοφία (Sofya) is governed by the University of Nebraska Open Academic License. You must read and accept all of the terms and conditions of this license prior to downloading, installing and/or using the software.

The current version ( 2.1.7) of Σοφία can be downloaded from the SofyaForJava Git repository. Previous versions are also avaiable there. Each version is provided in archive format supporting the installation instructions provided below.

The Σοφία Java analysis system is written entirely in Java, so it is theoretically possible to install and run the system on any architecture for which the Java JDK/JRE version 1.5 or greater is available. The system has been extensively tested on Solaris (SunOS), SuSE Linux 9.1, and to a lesser extent on Red Hat Linux 9.0, Fedora Core 4, Gentoo 2006.0, and Windows 2000/XP. We have no experience running it on later versions of Linux and Windows although this should be possible. Most recently, we have had some success running Σοφία on Java 7, but complete compatibility is not guaranteed due to continuing changes to the JVM and class file header formats that the BCEL library lacked support for. BCEL has been updated and these updates may allow Σοφία to work properly on Java 7 and 8.

The Σοφία tool uses the Bytecode Engineering Library (BCEL) for class file parsing and instrumentation. Earlier versions of Σοφία software required the BCEL version 5.2 library (available here). The latest version (2.1.7) of Σοφία uses BCEL 6.0 which is included within the Σοφία package, or the jar can be downloaded here. You may also try using the latest version of BCEL (6.6) from the official site. BCEL 6.6 offers compatibility with Java 8. We have not tried building/experimenting with Σοφία using this latest BCEL version so feel free to do so. We also welcome anyone wishing to update the tool to accommodate Java 8 and beyond. The text-based output format provided by Σοφία makes it useful for automated analysis and graph generation. Installation instructions for BCEL are provided below.

Do the following to install Σοφία.

Install Σοφία

  1. Choose where to extract the Σοφία system. On extraction, a directory called "sofya" will be created in this location.
  2. Unzip the package using gunzip: gunzip sofya.tar.gz
  3. Extract the resulting archive: tar -xvf sofya.tar
  4. Alternatively, you can do the unzip and extract in a single command: tar --gunzip -xvf sofya.tar.gz
  5. All the files should be extracted into subdirectories in the "sofya" directory. This directory is the root directory for the entire Σοφία system.
  6. Create a directory named ".sofyadb" in your home directory. This will act as the database for Σοφία, where it will store most of its outputs.
  7. Add the location of Σοφία to your Java classpath. Suppose you extracted Σοφία into a directory named "tools" in your home directory. Then you would execute the following command (in csh/tcsh):

    setenv CLASSPATH "${CLASSPATH}":${HOME}/tools/sofya/sofya.jar

    You may prefer to add this to your classpath in your shell's startup script.
  8. Add the supporting libraries required by Σοφία to your classpath:

    setenv CLASSPATH "${CLASSPATH}":${HOME}/tools/sofya/lib/commons-collections.jar:${HOME}/tools/sofya/lib/trove/lib/trove.jar:${HOME}/tools/sofya/lib/bcel-6.0.jar

Install BCEL

If you have downloaded version Sofya 2.1.7, the bcel 6.0 beta version is provided within the sofya/lib directory.

  1. Include the sofya/lib/bcel-6.0.jar file on you classpath, assuming that you unzipped sofya into your ${HOME}/tools directory (in csh/tcsh):

    setenv CLASSPATH "${CLASSPATH}":${HOME}/tools/sofya/lib/bcel-6.0.jar

    in Bash: CLASSPATH=${CLASSPATH}:${HOME}/tools/sofya/lib/bcel-6.0.jar

If you have downloaded an earlier Sofya version (prior to version 2.1.7) or wish to try the latest BCEL from the official Apache Commons site follow these steps:

  1. Choose where to extract the BCEL system
  2. Unzip the package using gunzip: gunzip bcel-5.2.tar.gz
  3. Extract the resulting archive: tar -xvf bcel-5.2.tar
  4. Alternatively, you can unzip and extract by the single command: tar --gunzip -xvf bcel-5.2.tar.gz
  5. All the files should be extracted into subdirectories in the "bcel-5.2" directory. This directory is the root directory for the BCEL library.
  6. Add the location of the BCEL library to your Java classpath. Suppose you extracted BCEL into your home directory. Then you would execute the following command (in csh/tcsh):

    setenv CLASSPATH "${CLASSPATH}":${HOME}/bcel-5.2/bcel-5.2.jar

    If you instead downloaded the BCEL 6.0 jar, you would put it on your Java classpath, replacing the ${HOME}/bcel-5.2/bcel-5.2.jar portion with the path to where you placed the BCEL 6.0 jar, e.g. ${HOME}/bcel-6.0/bcel-6.0.jar. You may prefer to add this to your classpath in your shell's startup script.
  7. If you choose to use the latest BCEL with Java 8 support, download and extract the library in the same way specifying the latest BCEL library's directory and jarfile name, e.g. ${HOME}/bcel-6.6.1/bcel-6.6.1.jar.


Author: Alex Kinneer © 2006 University of Nebraska - Lincoln.

Page last updated by Wayne Motycka: 08/27/2018