Back to psychWithJava page

Preparing Matlab to use psychWithJava

This section explains how to prepare Matlab for development with psychWithJava package. Setup involves two steps: Setting the JVM version and setting the javaclasspath variable. OS specific instructions are given in alphabetical order.

Step 1: Set the JVM version
Launch Matlab on your system and check the Java version. Type
version -java
and press enter. If the reported Java version is not 5.0 (or 1.5) then you will have to configure your system to make Matlab use version 5.0. This is explained here or here. I give the current instructions below, but for most recent instructions you should follow the above links.

Linux:

Mac OS X:

MS Windows 2000/XP:

You can use the classes of psychWithJava from any directory on your system. However, to do so you have to include the path to your java packages in the javaclasspath variable. In order to find class definitions, Matlab searches directories and files that are set in the javaclasspath variable. There are two ways of setting the javaclasspath in Matlab. One is static, other is dynamic. Static one sets the path permenantly until you change the settings. That is, you don't need to set the path every time you launch Matlab. Dynamic path is temparory and lives only during the session in which you set it.

Setting a dynamic path.

Setting the static path