1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> |
---|
2 | |
---|
3 | <html> |
---|
4 | |
---|
5 | <head> |
---|
6 | <title>J User's Guide - Compilation Buffers</title> |
---|
7 | <LINK REL="stylesheet" HREF="j.css" TYPE="text/css"> |
---|
8 | </head> |
---|
9 | |
---|
10 | <body> |
---|
11 | |
---|
12 | <a href="contents.html">Top</a> |
---|
13 | |
---|
14 | <hr> |
---|
15 | |
---|
16 | <h1>Compilation Buffers</h1> |
---|
17 | |
---|
18 | <hr> |
---|
19 | |
---|
20 | <p> |
---|
21 | J can run compilers for languages like Java and C, redirecting the output into |
---|
22 | a compilation buffer. For some compilers, including javac, jikes, gcc, and |
---|
23 | Microsoft C/C++, j can also parse the compiler's error messages and jump to |
---|
24 | the location in the source file where the error occurred. (Please note that on |
---|
25 | Windows, compilation buffers are only supported for Windows 2000 and Windows |
---|
26 | XP.) |
---|
27 | </p> |
---|
28 | <p> |
---|
29 | The command <a href="commands.html#compile">compile</a>, mapped by default to |
---|
30 | F9, can be used to run make, |
---|
31 | <a href="http://jakarta.apache.org/ant/index.html">Ant</a>, or a compiler. You |
---|
32 | will be prompted for the compile command. The current directory (the directory |
---|
33 | of the file in the current buffer) is used as the working directory for the |
---|
34 | execution of the compile command, so if you're using make or Ant, the Makefile |
---|
35 | or build.xml in the current directory will be used by default. |
---|
36 | </p> |
---|
37 | <p> |
---|
38 | The command <a href="commands.html#recompile">recompile</a>, mapped by default |
---|
39 | to Ctrl F9, repeats the last compile command you specified. To make this |
---|
40 | command more useful, you can use the dynamic alias "here" in your compile |
---|
41 | command to represent the full pathname of the current file (the file in the |
---|
42 | current buffer). |
---|
43 | <p> |
---|
44 | For example, you could specify the compile command: |
---|
45 | <pre> |
---|
46 | javac -classpath /home/peter/j/src here</pre> |
---|
47 | Then you could use <a href="commands.html#recompile">recompile</a> in any |
---|
48 | buffer containing a Java source file to run javac (with the specified |
---|
49 | classpath) on that particular file. |
---|
50 | <p> |
---|
51 | When you start a compilation, j displays the compilation buffer in another |
---|
52 | window, splitting the current window if necessary. Keyboard focus remains in |
---|
53 | the source window. |
---|
54 | </p> |
---|
55 | <p> |
---|
56 | If the compilation completes without error, you can use |
---|
57 | <a href="commands.html#escape">escape</a>, mapped by default to Escape, to |
---|
58 | kill the compilation buffer and unsplit the window. |
---|
59 | </p> |
---|
60 | <p> |
---|
61 | If there are errors, you can use the command |
---|
62 | <a href="commands.html#nextError">nextError</a>, mapped by default to F4, to |
---|
63 | jump to the location of each error in the source. |
---|
64 | </p> |
---|
65 | <p> |
---|
66 | In the compilation buffer itself, the command |
---|
67 | <a href="commands.html#thisError">thisError</a>, mapped by default to Enter, |
---|
68 | jumps to the location in the source file that corresponds to the error message |
---|
69 | at the current location of the caret. |
---|
70 | (<a href="commands.html#thisError">thisError</a> is also mapped by default to |
---|
71 | Ctrl Shift G, left button double click, and middle button single click.) |
---|
72 | </p> |
---|
73 | <p> |
---|
74 | The |
---|
75 | command <a href="commands.html#showMessage">showMessage</a>, mapped by default |
---|
76 | to Alt M, displays the full text of the current error message. |
---|
77 | </p> |
---|
78 | <p> |
---|
79 | Note that when using jikes, you must specify the +D flag in the compile |
---|
80 | command (or Makefile) in order for j to be able to parse the error messages |
---|
81 | correctly: |
---|
82 | <pre> |
---|
83 | jikes +D [...] here</pre> |
---|
84 | </body> |
---|
85 | |
---|
86 | </html> |
---|