Workspace setup

A few environment variables need to be set in order to run KnowRob. If you use Java code (which several KnowRob packages do), you may need to set the JAVA_HOME and SWI_HOME_DIR environment variables, e.g. by adding these lines to your ~/.bashrc file:

export JAVA_HOME=/usr/lib/jvm/default-java
export SWI_HOME_DIR=/usr/lib/swi-prolog

You further need to add the Java directories to your LD_LIBRARY_PATH environment variable. Choose either of the following dependent on your system architecture:

# for amd_64 systems (64 bits):
export LD_LIBRARY_PATH=/usr/lib/jvm/default-java/jre/lib/amd64:/usr/lib/jvm/default-java/jre/lib/amd64/server:$LD_LIBRARY_PATH
# for i386 systems (32bits):
export LD_LIBRARY_PATH=/usr/lib/jvm/default-java/jre/lib/i386:/usr/lib/jvm/default-java/jre/lib/i386/server:$LD_LIBRARY_PATH

It is further recommended to add the following to your ~/.plrc file (create it if it does not exist). This will give you a global command history for the Prolog shell, which is very convenient when you have to repeatedly restart Prolog during testing and debugging.

  rl_write_history :-
      expand_file_name("~/.pl-history", [File|_]),
  :- (
      current_prolog_flag(readline, true)
      expand_file_name("~/.pl-history", [File|_]),
      (exists_file(File) -> rl_read_history(File); true),