Preparing for jEdit plugin development

When I started using jEdit it took me a while to figure out how to begin building and developing jEdit and its plugins. I don’t know of a well documented tutorial, so I’m documenting the way I get started here. I typically develop on Windows, but most steps equally apply on Linux. I strongly recommend using jEdit trunk, it is very stable and is required for the latest and greatest plugins.

  1. Install subversion
  2. Install the Sun Java JDK. Unfortunately, the completely free IcedTea JDK isn’t up to running jEdit.
  3. Download Apache ant and put the bin directory in your path.
  4. You’ll need xsltproc and docbook to build the jEdit documentation. Download the docbook xsl scripts from http://sourceforge.net/project/showfiles.php?group_id=21935&package_id=16608&release_id=603854 and unpack somewhere (I unpack into c:\workspace\docbook, this path is needed later in step 7). The above links to version 1.74. The most recent version can be found from http://wiki.docbook.org/topic/DocBookXslStylesheets.
  5. Download xsltproc. I downloaded a binary from http://xmlsoft.org/XSLT/downloads.html. On Windows, you’ll also need iconv.dll, zlib1.dll, libxslt.dll, libxml2.dll, and libexslt.dll to run xsltproc.exe. Put the exe and dll’s in your path.
  6. Check-out jEdit from svn:
    svn co https://jedit.svn.sourceforge.net/svnroot/jedit/jEdit/trunk jEdit
  7. Create jEdit’s build.properties from the build.properties.sample file:
    cd jEdit
    cp build.properties.sample build.properties

    Edit the build.properties file to point to your xslt installation. The following are the lines I add (the path to docbook.xsl should match the directory in step 4):

    xsltproc.executable=C:\\workspace\\bin\\xsltproc.exe
    docbook.xsl=C:\\workspace\\docbook\\docbook-xsl-1.74.0
    docbook.catalog=C:\\workspace\\docbook\\docbook-xsl-1.74.0\\catalog.xml
  8. Now build jEdit, run:
    ant
    ant userdocs

    This builds jedit.jar and the userdocs in the build directory (a normal jEdit prints numerous warnings that can be ignored). You can run this jEdit with something like:

    javaw.exe -Xmx1024M -Dswing.aatext=true -Dawt.useSystemAAFontSettings=lcd -Dsun.java2d.d3d=false -jar build\jedit.jar
  9. If the above was successful, you should now have a .jedit settings directory in your home directory. We can now setup the necessities for building a plugin. Go to your settings directory and check-out jEdit’s build-support.
    cd ~/.jedit/jars
    svn co https://jedit.svn.sourceforge.net/svnroot/jedit/build-support/trunk build-support
  10. Now copy the build-support build.properties sample and edit for your installation (should still be in ~/.jedit/jars).
    cp build-support\build.properties.sample build.properties

    Edit build.properties to set the jEdit install directory (I don’t change anything else). On my system, that line looks like this:

    jedit.install.dir=c:\\workspace\\jedit\\jEdit\\build
  11. Finally, check-out a plugin to build and build it.
    svn co https://jedit.svn.sourceforge.net/svnroot/jedit/plugins/VoxSpell/trunk VoxSpell
    cd VoxSpell
    ant

    This should build VoxSpell and place the jar file in your settings directory plugin-jars directory. The next time you start jEdit it will find the jar file and load the plugin.

Feb 08 2009 11:57 am | Java and Programming | Comments Off