Back

Building projects with command line tools

This section explains how to build and run pure Java programs using psychWithJava package and comand line tools. Make sure that you have installed java development kit (JDK) and psychWithJava package, and configured your system.

Create a .java file

Compiling

    Open a terminal, or command window. Navigate to the directory where you downloaded the files. Type
    javac HelloPsychophysicist.java
    and press enter. If there were no errors you should have a file named HelloPsychophysicist.class in your directory.

Running

    To execute the java program you just compiled, type
    java HelloPsychophysicist
    and press enter. Note that when you execute java programs you give only the name of the class without the .class extension.