Personal tools
You are here: Home documentation Installing pdj

Edit history

Edit: -1 of 1
Time: 2012-05-24 13:44:22
Note: /pd/pd/docs/InstallingPdj/edit

[ pdj] allows you to write OS-independent pd externals in Java. It is a clone of the '''mxj''' object for Max/MSP, so that the Java code that you write for '''pdj''' should(!) also run fine in '''mxj'''.

I found personally hard to install in my Dell Latitude E6400 the current pdj version (0.8.7) under Linux Ubuntu 12.04 with pd-extended 0.43.1 beta.

Here is the procedure I followed:

 * Assume to have '''ant''' and Sun Java(TM) Development Kit (JDK) 7 installed (both by '''synaptic''' or similar archive manager)
 *[ download pdj] for your OS. Unpack, for example in a separate folder on the '''~/Download''' directory 
 *[ download] the puredata 0.43.1 source tarball. Unpack, then copy only the src folder into your existing pd-extended folder. Probably like this:
sudo cp -r src /usr/lib/pd-extended/
 * configure '''''' inside '''pdj-0.8.7/''' this way through you preferred text editor (edit accordingly if you have an amd64 equivalent machine):
# property file for Linux, now with default ubuntu packages

# put the path of where the jdk (java sdk) is installed

# put the path of where pd is installed

# common linux properties

# 64-bits system ? uncomment this

 * build inside pdj-0.8.7/:
sudo ant package
(I noticed several warnings)
 * copy the folder '''dist''' in your additional externals folder of puredata, and rename it as '''pdj'''. In my case:
sudo cp -r dist /usr/local/lib/pd-externals/
sudo mv /usr/local/lib/pd-externals/dist /usr/local/lib/pd-externals/pdj
 * add needed classes (folder '''pdj-0.8.7/work/com''') inside the new folder. In my case: 
cd /usr/local/lib/pd-externals/pdj/classes
sudo cp - r ~/Downloads/temp/pdj-0.8.7/work/classes/com .
 * make the new additional externals visible by puredata (Edit -> Preferences -> New... -> /usr/local/lib/pd-externals/pdj)
 * configure '''''' in (the easiest) way for puredata to run the test classes:
# this is the pdj classpath (dynamic) to set :

# this will print all .jars that are loaded before compiling/loading the 
# user class

# the type of compiler to use with the pdj classloader. use only 'javac' 
# or 'jikes'. do not put full path to your compiler
# to disable the automatic compilation simply use 
# pdj.compiler=null

# pdj compiler/classloader directory. by default, ${pdj.home}/classes 
# directory is used if this property is not defined. Before compiling, pdj
# will check if your .java needs to be compiled.

# this will redirect the java out/err streams to the pd console. If you need
# to log pdj errors and exceptions to stderr and stdout, set this to false.
# the jvm to use. If it is not found and the system is on Windows, 
# the jvm installed with the registry will be used. Not used on OS X

# the JVM version to use with OS X; linked to the Java Framework on OS X

# NOTE: pdj.home is set automagicly from where the pdj.pd_linux or pdj.dll 
# is installed (you need to put it in your pd path in OS X)

# =========================================================================
# to monitor memory and thread usage with 1.5 (jconsole) use 
# to do remote debugging at port 8000
#   -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000
# to check jni calls
#   -Xcheck:jni -verbose:jni
# All arguments on the same line just like $ java -X... -X... myclass
pdj.vm_args=-Xincgc -Xms32m -Xmx256m 

# tells pdj what type of jvm it must use: client or server. Not used on 
# OS X. client has lower starting time and can take less memory. server
# starts slower and takes more memory, but once the code is executed, 
# it will be faster than in client mode.

The test patches should work fine at this point.

The following note, left by '''Hans''', may solve visibility problems encountered by puredata, when running a '''pdj~''' module when it is opened for the first time.

 *made a symlink to pdj.pd_linux (GNU/Linux) or pdj.pd_darwin (Mac OS X) and make it called pdj~.pd_linux (GNU/Linux) or pdj~.pd_darwin (Mac OS X) like:

cd ~/pd-externals
ln -s pdj.pd_linux pdj~.pd_linux

(Mac OS X)
cd ~/Library/Pd
ln -s pdj.pd_darwin pdj~.pd_darwin

Powered by IEM Powered by Plone Section 508 WCAG Valid XHTML Valid CSS Usable in any browser