Setting up jEdit for Compiling Java CodeNote: I only
know how to barely make these programs work. If you ask me about specifics, then
I probably can't help you.
Tutorial (This tutorial isn't really designed for the jEdit version of
JSwat, but it may still be helpful.)
Suggested Plugins (Go to the Plugins menu in jEdit and
select Plugin Manager. From there you can easily install plugins. Don't bother
trying to download them from the web page.)
- JBrowse - Helps you to navigate your Java code.
- JCompiler - Allows you to easily compile your file from the Plugins menu.
- JSwat - A Java debugging interface. (It needs the Common Controls plugin.)
- XML - Helps a little with editing html code.
- There are some other neat looking plugins that you may want. You should
browse the list of plugins yourself.
Preparing jEdit for Windows
- From the Start Menu, select All Programs->jEdit->Set jEdit
- For the "Location of Java application loader" option, choose the javaw.exe
file in your Java SDK directory. (For example, mine is
- Running off of the SDK version of javaw.exe may help with some plugins.
- Open your Java code file in the jEdit text window.
- Goto the Plugins menu and select JCompiler->Compile File.
- The file will automatically be compiled and placed in the directory with
your Java code.
- By default, the code is compiled with debugging information. You can
change this by selecting JCompiler->JCompiler Options from the Plugins
Setting up JSwat
- Goto the Plugins menu and select JSwat->Show Options.
- Set the options as follows:
- Java home: You need to type in your Java SDK directory. (For
- Java executable: java
- JVM parameters: -classic (Actually, this is just the default
- Class name: The name of your class. (For example, if you download
code (from the JSwat
Tutorial page) and compile it, then you would enter "tutorial".)
- Application parameters: Any console parameters for your program.
- Class path: Specify where your class files that will be debugged
can be found. (If you have spaces in your path, then be sure to put double
quotes around your path. Also, if you use the "..." button to select your
path, then be sure that it outputs correctly. I was having problems with the
last directory in the path showing up twice, so the debugger couldn't find
the directory. If it is incorrect, you will have to edit the path manually.
An example path would be "F:\Java\tutorial".)
- Source path: Specify where your java (source) files that will be
debugged can be found. (This is most likely the same as the previous option
unless you are more organized than I am. An example path would be
- Start VM suspended: When checked, the dubugger will start
- Show options before starting: When checked, this dialog will open
when you try to start debugging.
Quicky JSwat for jEdit Tutorial
- Download the tutorial file and save it in a directory: tutorial.java
- Open the file in jEdit.
- Compile the file using JCompiler as explained above.
- Click on line 12 of the source file: pushCount++;
- Goto the Plugins menu and select JSwat->Add Breakpoint. A red mark
should appear next to the line.(This adds a breakpoint to your program, you
select Remove Breakpoint to remove it.)
- Goto the Plugins menu and select JSwat->Start/Resume VM.
- The JSwat Options dialog will pop up. Make sure everything is setup
correctly (as explained above), then press Ok.
- The JSwat debugger will start suspended. Press the "vmResume" button at
the top of the JSwat window.
- Wait a moment for all of the threads to start. Several should fill the
area below the "Threads" tab.
- The tutorial window should appear somewhere on your desktop. Find it and
click on the big "Push me" button.
- The program should have stopped on the line with a breakpoint and that
line should be highlighted.
- Click the "Locals" tab at the top of the JSwat window.
- Open up the "this (tutorial)" object by clicking on the circle next to the
folder icon. Notice that the variables in your object can be viewed here.
"pushCount (int)" is currently 0. (The variable type is shown in the
- Click the "next" button at the top of the JSwat window.
- Open up the "this (tutorial)" object again. Notice that "pushCount (int)"
is now 1.
- Click the "next" button a couple more times.
- Notice that more local variables show up under the "Locals" tab; you can
observe these too.
- Click the "vmResume" button to continue the execution.
- Close the tutorial window.