Setting up jEdit 5.5 to use with Topas
You should be able to set up any version of jedit to work with any version of topas after 4.1. These instructions are for jedit 5.5. If you have problems, then try the jEdit 4.3 setup instructions. These have worked on 1000s of computers world wide.
If you use jedit with topas please register here; I’ll periodically send information about updates and bug fixes.
Thanks to Fabio Furlan Ferreira for updating the v7 menus.
0. Note on privileges, folders, etc
Many universities now have centrally-managed computers where users can’t write to local drives and don’t have any admin/install privileges. TOPAS normally needs to sit in a local folder where the user has write access. It’s also convenient to have write access to the jEdit folder. Installation on university computers can therefore be a bit painful and/or may only work for a single login id.
The solution to this will be different depending on your university’s set up. In Durham the easiest way is currently (January 2020) to have a folder called C:\topas_v6 and a folder called C:\jedit on the local C: drive. These folders (only) need to be full access (read, write, execute) for all users. You might need to use the windows commad “icacls” to achieve this. Avoid spaces in these directory names. Our IT service are willing to grant this level of access. Persuade yours to do the same! jEdit can be installed to this directory by an administrator or anybody with “Run as administrator priveleges” (right click and select option rather than just double clicking.
1. Download and install Java if it’s not already installed.
To run jedit you may need to install Java run time environment (jre). You probably won’t need to do this on a reasonably up to date pc. You need a reasonably up to date version latest versions of jedit (e.g. 1.8 or Java 8 for jedit 5.5), but can use older versions (1.5) for jedit 4.3.
Jan 2024: There are recent changes to jre licensing which may affect some people. OpenJDK 21 appears to work fine with jEdit 5.6 and will probably work with earlier versions too (thanks Anthony!).
2. Download jedit installation and set up files
Dowload the single .zip file linked here. This contains all the files needed to install jedit and configure it for use with topas. Extract this to any folder on your hard disk. It will create a directory called “jedit55_setup” which contains all the files you need. N.B. these represent a frozen version of jedit and plugins. More up to date versions of jedit are available from the group that develop jedit at http://www.jedit.org, but I don’t guarantee they work with topas.
3. Install jEdit 5.5
Install jedit5.5 by running the file jedit5.5.0install.exe which is in the “jedit55_setup” folder.
jEdit will normally install into two directories:
Application: c:\program files\jedit
Users data: C:\Users\username\AppData\Roaming\jEdit (windows 10) or somewhere like c:\documents and setting\USER\.jedit (windows 7)
You can find out the specific directory names on your computer by looking in the utilities menu for the “jEdit home directory” and “Settings directory”. Make sure you quit/relaunch jEdit before you do this or the settings directory may not be correct.
4. Install Plugins
To gain the full power of jedit you need to install various plugins (xinsert, console, editor scheme, xsearch and errorlist).
In the “jedit_setup” folder you’ll find a folder called “jars”. Copy all the files in this folder to C:\Users\username\AppData\Roaming\jEdit\jars or the equivalent directory on your computer (find it with utilities/Settings directory in jEdit menus).
You’ll then need to restart jedit
(In some installations these may need to go to c:\program files\jedit). Note that the jEdit settings directory may be “hidden” by default on your computer. If so, go to the “view” tab in windows explorer and tick to show hidden files.
If the above steps don’t work, you can install these plugins using the plugin manager in jedit. Do whichever works for you.
5. Setting up jEdit for editing INP files
To set up jedit to interact with topas you need to run a macro (inp-setup.bsh) within jEdit. This macro is in the “jedit55_setup” directory. In jEdit go to:
Macros/Run Other macro/navigate and select inp-setup.bsh (in “jedit55_setup” directory).
[N.B. a few people have reported problems when topas is installed in a directory name including spaces. If you have a choice, I strongly recommend using a directory name without spaces. C:\topasa is what we use in Durham. Remember though that the license Alan sends you is directory specific – if you change the topas directory name the software will no longer run.]
You may then need to quit jEdit and relaunch it for changes to take place.
To automatically colour code your input files: Go to Plugins/Editor Scheme Selector and select “inp.scheme” from the left hand window then click Apply and Close. Now topas key words will be in dark blue, numbers in royal blue, refined numbers in red, comments in green, etc. These colour rules are defined in INP.JEDIT-SCHEME and INP_MODE.XML.
By default jEdit settings are changed to my preferences: all xinsert menus turned off except topas ones; files not re-opened on start up; explicit folding set on.
6. Editing in jedit
At its simplest level jedit can be used like any other text editor. The xinsert menus and the ability to automatically colour code certain parts of the file make it extremely efficient for creating and viewing topas input files.
Column editing is an extremely powerful feature of jedit and allows you to e.g. edit large numbers of atoms simultaneously. Hold down the ctrl key and select a column of text. What you type will then appear in all rows.
Jedit allows predictive completion of topas keywords. In any .inp file try typing “app” then hitting ctrl-b. You’ll be given a choice of possible keywords.
Hypertext searching is a very rapid way of finding multiple occurences of an expression in a file. Highlight a text string, hold down alt and press “.” (full stop or period depending on your location).
The cursor shape and whether it blinks can be changed using: Utilities/Global Options/Text Area
If everything has been set up properly your jedit screen should look something like the image below (click for higher resolution) but with more modern icons!
8. Commercial Topas
jEdit should work with the commercial version of Topas. You just need to make sure you are in launch mode not gui mode (press the “rocket” icon in the run window). If you want the various example files linked from menus then download the zip file linked here and extract to a folder called “test_examples” in your main topas folder.
Go here for some simple jedit examples.
If you haven’t already done so, please register here. I’ll periodically send information about updates and bug fixes.