Working with Source Code

This section deals with features that work with source code.

1. Compiling source code
Q:. How do I compile my Java source in JEdit?
Q:. How do I create a new edit mode?
Q:. Does jEdit support DocBook tags?

1. Compiling source code

Q:. How do I compile my Java source in JEdit?
Q:. How do I create a new edit mode?
Q:. Does jEdit support DocBook tags?
Q:.

How do I compile my Java source in JEdit?

A:.

There are a number of plugins that you can use to compile Java source code. You can run a Java compiler on the command line in the "System" shell of the Console plugin. If you are using the JCompiler plugin, you will have a "JCompiler" shell in the Console plugin, and you can run the compile command for the current file, or the compilepkg command on all of the current directory's source code files. You can also use the "Ant" shell in the Console plugin or the AntFarm plugin to run complex builds on a project of source code files, using a build.xml file to specify build commands and dependencies.

Q:.

How do I create a new edit mode?

A:.

Take a look at the "Writing Edit Modes" section of the User's Guide. Basically, you have to write an XML file containing data on the mode's file extensions and buffer and syntax highlighting properties, then add information about the new mode file to a second XML file containing a catalog of modes.

Q:.

Does jEdit support DocBook tags?

A:.

The application contains editing modes for both SGML and XML, and there are a number of abbreviations in the SGML mode that create pairs of DocBook tags on the fly. You can auto-complete closing tags with the XML plugin, and with the XInsert or Template plugin you can create multi-layered DocBook elements. The installation macro Insert_Tag.bsh is useful for creating or inserting tag pairs in existing text, and there are other macros targeting DocBook available from the jEdit Community web site that you can use or adapt for your own purposes.