| 1 | <?xml version="1.0"?> | 
|---|
| 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | 
|---|
| 3 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | 
|---|
| 4 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | 
|---|
| 5 | <head> | 
|---|
| 6 | <title>Installing armedbear the Java way</title> | 
|---|
| 7 | <base href=""> | 
|---|
| 8 | <link rel="stylesheet" | 
|---|
| 9 | type="text/css" | 
|---|
| 10 | href="abcl-css.css"> | 
|---|
| 11 | <link rel="stylesheet" | 
|---|
| 12 | type="text/css" | 
|---|
| 13 | href="http://common-lisp.net/project/armedbear/style.css"/> | 
|---|
| 14 | </head> | 
|---|
| 15 |  | 
|---|
| 16 | <body> | 
|---|
| 17 | <a name="top"></a> | 
|---|
| 18 | <div class="header"><h1>armedbear</h1></div> | 
|---|
| 19 |  | 
|---|
| 20 | <a href="http://common-lisp.net/project/armedbear/">home</a> | 
|---|
| 21 |  | 
|---|
| 22 | <div id="welcome"> | 
|---|
| 23 | <pre> | 
|---|
| 24 | C:\temp\abcl\abcl-src-0.12.0\dist>java -jar abcl.jar | 
|---|
| 25 | Armed Bear Common Lisp 0.12.0 | 
|---|
| 26 | Java 1.6.0_05 Sun Microsystems Inc. | 
|---|
| 27 | Java HotSpot(TM) Client VM | 
|---|
| 28 | Low-level initialization completed in 1.262 seconds. | 
|---|
| 29 | Startup completed in 4.556 seconds. | 
|---|
| 30 | Type ":help" for a list of available commands. | 
|---|
| 31 | CL-USER(1): (list 'welcome 'to 'lisp!) | 
|---|
| 32 | (WELCOME TO LISP!) | 
|---|
| 33 | CL-USER(2): | 
|---|
| 34 | </pre> | 
|---|
| 35 | </div> | 
|---|
| 36 | <h1>Installing the Java way</h1> | 
|---|
| 37 |  | 
|---|
| 38 | <p> | 
|---|
| 39 | This page describes one way Java programmers can use to build an application. | 
|---|
| 40 | In addition to the Java development kit, which is described below, this way | 
|---|
| 41 | also uses a tool called Ant. Ant is a program familiar to Java developers. It | 
|---|
| 42 | performs the same sort of tasks that make does for C programmers, ie it | 
|---|
| 43 | provides a convenient means of managing the compilation and program building | 
|---|
| 44 | tasks that a complex application requires. | 
|---|
| 45 | </p> | 
|---|
| 46 | <p> | 
|---|
| 47 | Users of Java IDEs (Integrated Development Environment) such as | 
|---|
| 48 | <a href="http://www.eclipse.org/">Eclipse</a> or | 
|---|
| 49 | <a href="http://www.netbeans.org/">NetBeans</a> can build the ABCL JAR file | 
|---|
| 50 | within these environments. If you are using these tools you will have already | 
|---|
| 51 | downloaded the JDK, and these tools already have a version of Ant installed. | 
|---|
| 52 | See the documentation for these tools if you wish to use these to build the | 
|---|
| 53 | ABCL JAR file. | 
|---|
| 54 | </p> | 
|---|
| 55 | <p> | 
|---|
| 56 | To install ABCL from the source code as described on this page you need: | 
|---|
| 57 | </p> | 
|---|
| 58 | <ul> | 
|---|
| 59 | <li>the Java runtime system, which will probably already be installed | 
|---|
| 60 | on your machine; | 
|---|
| 61 | </li> | 
|---|
| 62 | <li>the <a href="abcl-pbdoc.html#jdk">Java development kit</a>, which | 
|---|
| 63 | you have to download from Sun; | 
|---|
| 64 | </li> | 
|---|
| 65 | <li>and the <a href="abcl-pbdoc.html#ant">Ant</a> build tool for Java. | 
|---|
| 66 | </li> | 
|---|
| 67 | </ul> | 
|---|
| 68 |  | 
|---|
| 69 | <p> | 
|---|
| 70 | Once you have these pre-requisites sorted, you can then go ahead and | 
|---|
| 71 | <a href="#abcl">build ABCL</a>. If you wish to use Linux there are | 
|---|
| 72 | <a href="#linux">further steps</a> to perform. | 
|---|
| 73 | </p> | 
|---|
| 74 | <h2>The Java Runtime (JRE)</h2> | 
|---|
| 75 |  | 
|---|
| 76 | <p> | 
|---|
| 77 | ABCL needs at least Java 1.5. How do you know if you have this or not? Well, | 
|---|
| 78 | for Windows users the quickest way to find out is to open a new command window | 
|---|
| 79 | (click <i>Start</i>, then <i>Run</i>, type <tt>cmd</tt> and click <i>OK</i>). | 
|---|
| 80 | At the command prompt type <tt>java -version</tt>. If you have the | 
|---|
| 81 | <tt>Java.exe</tt> executable in your path you will see output similar to this: | 
|---|
| 82 |  | 
|---|
| 83 | <pre> | 
|---|
| 84 | C:\>java -version | 
|---|
| 85 | java version "1.6.0_11" | 
|---|
| 86 | Java(TM) SE Runtime Environment (build 1.6.0_11-b03) | 
|---|
| 87 | Java HotSpot(TM) Client VM (build 11.0-b16, mixed mode, sharing) | 
|---|
| 88 | </pre> | 
|---|
| 89 |  | 
|---|
| 90 | <p> | 
|---|
| 91 | This will work because it is a version later than Java 1.5. However, if you get | 
|---|
| 92 | this response: | 
|---|
| 93 | </p> | 
|---|
| 94 | <pre> | 
|---|
| 95 | 'java' is not recognized as an internal or external command, | 
|---|
| 96 | operable program or batch file. | 
|---|
| 97 | </pre> | 
|---|
| 98 | <p> | 
|---|
| 99 | It means one of two things, either you don't have Java installed, or if you do | 
|---|
| 100 | it is not on your path. To check which one it is type: | 
|---|
| 101 | </p> | 
|---|
| 102 |  | 
|---|
| 103 | <pre> | 
|---|
| 104 | dir /s c:\java.exe | 
|---|
| 105 | </pre> | 
|---|
| 106 | <p> | 
|---|
| 107 | This command may take a long time to run, as it is doing a search of your hard | 
|---|
| 108 | drive, which may be large and have many files. (Of course you can, if you | 
|---|
| 109 | prefer, use the Windows search tool: <i>Start</i> -- <i>Search</i>.) A typical | 
|---|
| 110 | response may be: | 
|---|
| 111 | </p> | 
|---|
| 112 | <pre> | 
|---|
| 113 | C:\>dir /s \java.exe | 
|---|
| 114 | Volume in drive C is Windows | 
|---|
| 115 | Volume Serial Number is 7DDF-ABBD | 
|---|
| 116 |  | 
|---|
| 117 | Directory of C:\Program Files\Java\jre1.5.0_13\bin | 
|---|
| 118 |  | 
|---|
| 119 | 25/09/2007  19:26            49,248 java.exe | 
|---|
| 120 | 1 File(s)         49,248 bytes | 
|---|
| 121 |  | 
|---|
| 122 | Directory of C:\Program Files\Java\jre1.6.0_03\bin | 
|---|
| 123 |  | 
|---|
| 124 | 24/09/2007  21:30           135,168 java.exe | 
|---|
| 125 | 1 File(s)        135,168 bytes | 
|---|
| 126 |  | 
|---|
| 127 | Directory of C:\Program Files\Java\jre1.6.0_05\bin | 
|---|
| 128 |  | 
|---|
| 129 | 22/02/2008  00:23           135,168 java.exe | 
|---|
| 130 | 1 File(s)        135,168 bytes | 
|---|
| 131 | </pre> | 
|---|
| 132 | <p> | 
|---|
| 133 | <img class="java-image" src="javajre.jpg"> | 
|---|
| 134 | If you don't get any results then you don't have the Java runtime system | 
|---|
| 135 | installed. To install it go to <a href="http://java.com">java.com</a>, and | 
|---|
| 136 | click the big blue button that is on that page (it's not subtle, as you | 
|---|
| 137 | can see from the image at right!). Be aware that Java downloads are quite | 
|---|
| 138 | large, so if you need to install or upgrade your version of Java you should | 
|---|
| 139 | do this when you have access to decent Internet bandwidth. | 
|---|
| 140 | </p> | 
|---|
| 141 | <p> | 
|---|
| 142 | Your download will be an executable file. When you click the button there | 
|---|
| 143 | are full details on how to download and install the software on to your | 
|---|
| 144 | computer. | 
|---|
| 145 | </p> | 
|---|
| 146 | <p> | 
|---|
| 147 | The runtime system includes everything that you need to run a Java program. | 
|---|
| 148 | This means it has the core executables (eg <tt>java.exe</tt>), as well as | 
|---|
| 149 | all the supporting library files needed to make Java work with your | 
|---|
| 150 | particular operating system. However downloading the JRE alone is not | 
|---|
| 151 | enough... | 
|---|
| 152 | </p> | 
|---|
| 153 | <a href="#top">top</a> | 
|---|
| 154 |  | 
|---|
| 155 | <a name="jdk"></a> | 
|---|
| 156 | <h2>The Java Development Kit (JDK)</h2> | 
|---|
| 157 |  | 
|---|
| 158 | <p> | 
|---|
| 159 | The JDK is a different beast to the runtime environment (JRE). You need the | 
|---|
| 160 | JRE to actually execute Java code, and without it nothing will work. But if | 
|---|
| 161 | you want to go further and write your own Java programs, or compile Java | 
|---|
| 162 | code written by others, as we do here, then you will need more than the JRE | 
|---|
| 163 | -- you will need the Java development kit. The JDK gives you the basic | 
|---|
| 164 | tools to compile Java source code. How do you know if you have the JDK | 
|---|
| 165 | installed? Well again arguably the quickest way is to just search your hard | 
|---|
| 166 | drive for <tt>javac.exe</tt> (javac is the java compiler). If you get no | 
|---|
| 167 | response you don't have the JDK installed. | 
|---|
| 168 | </p> | 
|---|
| 169 | <p> | 
|---|
| 170 | As with the JRE the JDK is available for free from Sun. To download the | 
|---|
| 171 | <img class="java-image" src="javajdk.jpg"> | 
|---|
| 172 | version you are interested in go to the Sun | 
|---|
| 173 | website, <a href="http://java.sun.com">java.sun.com</a>, click on the <i>Java | 
|---|
| 174 | SE</i> link to the right and then choose the JDK. Alternatively you can use | 
|---|
| 175 | their search form -- just enter "JDK". Java comes in various 'flavours': the | 
|---|
| 176 | SE is the Standard Edition, and is the one you want; the others are EE, which | 
|---|
| 177 | is the Enterprise Edition, and is used for creating web-based solutions using | 
|---|
| 178 | Java Bean and Servlet technologies; and ME is the Micro Edition, used to run | 
|---|
| 179 | Java on small devices such as phones and PDAs. [Now how cool would it be to | 
|---|
| 180 | have Lisp on your phone? There's a thought!] | 
|---|
| 181 | </p> | 
|---|
| 182 |  | 
|---|
| 183 | <p> | 
|---|
| 184 | Make sure you download the JDK, not the JRE (unless of course you want to | 
|---|
| 185 | upgrade your current JRE to a different version). Sun offers the JDK with some | 
|---|
| 186 | of its other tools, such as NetBeans. NetBeans is an integrated development | 
|---|
| 187 | environment (IDE), which lets you edit your code in a window, and then run it, | 
|---|
| 188 | debug it, and manage your applications all within one package. There is a | 
|---|
| 189 | learning curve to NetBeans; it is a great IDE, but if you just want to get ABCL | 
|---|
| 190 | running you don't need all its bells and whistles. | 
|---|
| 191 | </p> | 
|---|
| 192 | <p> | 
|---|
| 193 | The JDK is even bigger than the JRE. For example, JDK 6 Update 12 is 73MB. | 
|---|
| 194 | Installation of the JDK follows the same process as for the JRE: save the | 
|---|
| 195 | executable to disk and then execute it. This does take quite some time, so | 
|---|
| 196 | please be patient. | 
|---|
| 197 | </p> | 
|---|
| 198 | <a href= "#top">top</a> | 
|---|
| 199 |  | 
|---|
| 200 | <a name="ant"></a> | 
|---|
| 201 | <h2>Ant -- the Java build tool</h2> | 
|---|
| 202 |  | 
|---|
| 203 | <p> | 
|---|
| 204 | Ant is an open source project managed by the Apache organisation, that is | 
|---|
| 205 | used to manage the compilation and building of larger Java projects. It's home | 
|---|
| 206 | <img class="java-image" src="ant-apache-org.jpg"> | 
|---|
| 207 | page is at <a href="http://ant.apache.org">ant.apache.org</a>. To download | 
|---|
| 208 | this tool go to their <a href="http://ant.apache.org/bindownload.cgi"> | 
|---|
| 209 | download</a> page. Choose the appropriate package for your platform (for | 
|---|
| 210 | example Windows users will select the zip archive). Extract the files from | 
|---|
| 211 | the package. Windows users can either user the built in feature of Windows | 
|---|
| 212 | explorer: double click on the zip file; in the window that pops up click | 
|---|
| 213 | <i>File</i> then <i>Extract All</i> (the fastest way to start Explorer: | 
|---|
| 214 | right-click on the <i>Start</i> button and click <i>Explore</i>). | 
|---|
| 215 | </p> | 
|---|
| 216 | <p> | 
|---|
| 217 | If you are on a Unix platform you can use <tt>tar</tt> to extract the files. | 
|---|
| 218 | As the package is a tar.gz file you can use the <tt>z</tt> option to tar to | 
|---|
| 219 | uncompress the archive, before extracting it. This command will both | 
|---|
| 220 | uncompress and extract the archive in one go (assuming, of course, that your | 
|---|
| 221 | archive is the 1.7.1 version of ant): | 
|---|
| 222 | </p> | 
|---|
| 223 |  | 
|---|
| 224 | <pre> | 
|---|
| 225 | tar zxvf apache-ant-1.7.1-bin.tar.gz | 
|---|
| 226 | </pre> | 
|---|
| 227 |  | 
|---|
| 228 | <p> | 
|---|
| 229 | The <a href="http://ant.apache.org/manual/index.html">installation | 
|---|
| 230 | instructions</a> are on the ant website. You should read through those to | 
|---|
| 231 | understand what needs to be done. The description below shows how these | 
|---|
| 232 | were applied when installing Ant on a Windows sytem. The first action that is | 
|---|
| 233 | required is to add the Ant bin directory to your system path. From a | 
|---|
| 234 | command prompt you can type the following commands. The first modifies the | 
|---|
| 235 | path variable, so the bin directory is visible from anywhere. The second | 
|---|
| 236 | command executes the <tt>ant</tt> executable. | 
|---|
| 237 | </p> | 
|---|
| 238 |  | 
|---|
| 239 | <pre> | 
|---|
| 240 | C:\temp\ant\apache-ant-1.7.1>PATH=%PATH%;C:\temp\ant\apache-ant-1.7.1\bin | 
|---|
| 241 |  | 
|---|
| 242 | C:\temp\ant\apache-ant-1.7.1>ant | 
|---|
| 243 | Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre1.6.0_05\lib\tools.jar | 
|---|
| 244 | Buildfile: build.xml does not exist! | 
|---|
| 245 | Build failed | 
|---|
| 246 | C:\temp\ant\apache-ant-1.7.1> | 
|---|
| 247 | </pre> | 
|---|
| 248 |  | 
|---|
| 249 | <p> | 
|---|
| 250 | Opps! No <tt>tool.jar</tt> file. Obviously this is part of the JDK, and | 
|---|
| 251 | so a quick search shows where it is. We can then set the <tt>JAVA_HOME</tt> | 
|---|
| 252 | and <tt>ANT_HOME</tt> environment variables and try again: | 
|---|
| 253 | </p> | 
|---|
| 254 |  | 
|---|
| 255 | <pre> | 
|---|
| 256 | C:\temp\ant\apache-ant-1.7.1>dir \tools.jar /s | 
|---|
| 257 | Volume in drive C has no label. | 
|---|
| 258 | Volume Serial Number is 7DDF-ABBD | 
|---|
| 259 | Directory of C:\Program Files\Java\jdk1.6.0_03\lib | 
|---|
| 260 |  | 
|---|
| 261 | 25/09/2007  00:11        12,171,847 tools.jar | 
|---|
| 262 | 1 File(s)     12,171,847 bytes | 
|---|
| 263 |  | 
|---|
| 264 | Total Files Listed: | 
|---|
| 265 | 3 File(s)     21,523,154 bytes | 
|---|
| 266 | 0 Dir(s)  11,194,011,648 bytes free | 
|---|
| 267 |  | 
|---|
| 268 | C:\temp\ant\apache-ant-1.7.1>set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_03 | 
|---|
| 269 |  | 
|---|
| 270 | C:\temp\ant\apache-ant-1.7.1>set ANT_HOME=C:\temp\ant\apache-ant-1.7.1 | 
|---|
| 271 |  | 
|---|
| 272 | C:\temp\ant\apache-ant-1.7.1>ant | 
|---|
| 273 | Buildfile: build.xml does not exist! | 
|---|
| 274 | Build failed | 
|---|
| 275 | C:\temp\ant\apache-ant-1.7.1>ant -version | 
|---|
| 276 | Apache Ant version 1.7.1 compiled on June 27 2008 | 
|---|
| 277 | C:\temp\ant\apache-ant-1.7.1> | 
|---|
| 278 | </pre> | 
|---|
| 279 |  | 
|---|
| 280 | <p> | 
|---|
| 281 | Success, my build failed! (How oxymoronic is that?) Note that these changes are | 
|---|
| 282 | only temporary. When you exit out of the command line shell you will lose | 
|---|
| 283 | these settings. To preserve them for future shell sessions do this: | 
|---|
| 284 | </p> | 
|---|
| 285 |  | 
|---|
| 286 | <ul> | 
|---|
| 287 | <li>Click <i>Start</i> -- <i>Control Panel</i>; | 
|---|
| 288 | </li> | 
|---|
| 289 | <li>Double click the <i>System</i> item, and click on the | 
|---|
| 290 | <i>Advanced</i> tab; | 
|---|
| 291 | </li> | 
|---|
| 292 | <li>Click the <i>Environment Variables</i> button; | 
|---|
| 293 | </li> | 
|---|
| 294 | <li>Find the <tt>PATH</tt> variable, and click <i>Edit</i>. | 
|---|
| 295 | Move to the end of the path (click in the lower box and press | 
|---|
| 296 | end), and add a semi-colon (<tt>;</tt>). Now append the path | 
|---|
| 297 | to the Ant bin directory; | 
|---|
| 298 | </li> | 
|---|
| 299 | <li>Click the <i>New</i> system variable button, and enter the | 
|---|
| 300 | variable name <tt>JAVA_HOME</tt> in the top box, with the | 
|---|
| 301 | appropriate value in the lower box. Then click <i>OK</i>; | 
|---|
| 302 | </li>Do the same again to set the <tt>ANT_HOME</tt> variable; | 
|---|
| 303 | <li>Finally, close all the windows by clicking <i>OK</i>. | 
|---|
| 304 | </li> | 
|---|
| 305 | </ul> | 
|---|
| 306 | <a href= "#top">top</a> | 
|---|
| 307 |  | 
|---|
| 308 | <a name="abcl"></a> | 
|---|
| 309 | <h2>Build ABCL</h2> | 
|---|
| 310 |  | 
|---|
| 311 | <p> | 
|---|
| 312 | OK, back to the build process. We are nearly there! You should change to the | 
|---|
| 313 | directory where you installed the ABCL source code. Once there you can run | 
|---|
| 314 | Ant against the <tt>build.xml</tt> file, which is the file that contains all | 
|---|
| 315 | the build instructions Ant needs to create the target Jar file. You specify the | 
|---|
| 316 | build file using the <tt>-f</tt> option. By default this file shows you a help | 
|---|
| 317 | message on how to use it: | 
|---|
| 318 | </p> | 
|---|
| 319 |  | 
|---|
| 320 | <pre> | 
|---|
| 321 | C:\temp\ant\apache-ant-1.7.1>cd \temp\abcl\abcl-src-0.12.0 | 
|---|
| 322 |  | 
|---|
| 323 | C:\temp\abcl\abcl-src-0.12.0>ant -f build.xml | 
|---|
| 324 | Buildfile: build.xml | 
|---|
| 325 |  | 
|---|
| 326 | help: | 
|---|
| 327 | [echo] Main Ant targets: | 
|---|
| 328 | [echo]  abcl.compile | 
|---|
| 329 | [echo]    -- compile ABCL to C:\temp\abcl\abcl-src-0.12.0/build/classes | 
|---|
| 330 | [echo]  abcl.jar | 
|---|
| 331 | [echo]    -- create packaged C:\temp\abcl\abcl-src-0.12.0/dist/abcl.jar | 
|---|
| 332 | [echo]  abcl.wrapper | 
|---|
| 333 | [echo]    -- create executable wrapper for ABCL | 
|---|
| 334 | [echo]  abcl.source.zip abcl.source.tar | 
|---|
| 335 | [echo]     -- create source distributions in C:\temp\abcl\abcl-src-0.12.0/dist | 
|---|
| 336 | [echo]  abcl.clean | 
|---|
| 337 | [echo]     -- remove ABCL intermediate files | 
|---|
| 338 | [echo] Corresponding targets for J exist, but currently aren't as well tested. | 
|---|
| 339 | [echo] | 
|---|
| 340 |  | 
|---|
| 341 | BUILD SUCCESSFUL | 
|---|
| 342 | Total time: 0 seconds | 
|---|
| 343 | C:\temp\abcl\abcl-src-0.12.0> | 
|---|
| 344 | </pre> | 
|---|
| 345 |  | 
|---|
| 346 | <p> | 
|---|
| 347 | We want to create the JAR (Java ARchive) file. So we specify the <tt>abcl.jar</tt> | 
|---|
| 348 | target, hit RETURN, and wait. Note that a large proportion of the output has been | 
|---|
| 349 | removed from the listing below: | 
|---|
| 350 | </p> | 
|---|
| 351 |  | 
|---|
| 352 | <pre> | 
|---|
| 353 | C:\temp\abcl\abcl-src-0.12.0>ant -f build.xml abcl.jar | 
|---|
| 354 | Buildfile: build.xml | 
|---|
| 355 |  | 
|---|
| 356 | abcl.pre-compile: | 
|---|
| 357 | [mkdir] Created dir: C:\temp\abcl\abcl-src-0.12.0\build | 
|---|
| 358 | [mkdir] Created dir: C:\temp\abcl\abcl-src-0.12.0\build\classes | 
|---|
| 359 | [echo] java.version: 1.6.0_03 | 
|---|
| 360 |  | 
|---|
| 361 | abcl.copy.lisp: | 
|---|
| 362 | [copy] Copying 188 files to C:\temp\abcl\abcl-src-0.12.0\build\classes | 
|---|
| 363 |  | 
|---|
| 364 | abcl.java.warning: | 
|---|
| 365 | [echo] WARNING: Java version 1.6.0_03 not recommended. | 
|---|
| 366 |  | 
|---|
| 367 | abcl.compile.java: | 
|---|
| 368 | [javac] Compiling 257 source files to C:\temp\abcl\abcl-src-0.12.0\build\cla | 
|---|
| 369 | sses | 
|---|
| 370 | [javac] Note: Some input files use unchecked or unsafe operations. | 
|---|
| 371 | [javac] Note: Recompile with -Xlint:unchecked for details. | 
|---|
| 372 |  | 
|---|
| 373 | abcl.fasls.uptodate: | 
|---|
| 374 |  | 
|---|
| 375 | abcl.compile.lisp: | 
|---|
| 376 | [java] Armed Bear Common Lisp 0.12.0 (built Mon Feb 23 2009 14:35:46 GMT) | 
|---|
| 377 | [java] Java 1.6.0_03 Sun Microsystems Inc. | 
|---|
| 378 | [java] Java HotSpot(TM) Client VM | 
|---|
| 379 | [java] Low-level initialization completed in 0.731 seconds. | 
|---|
| 380 | [java] Startup completed in 4.597 seconds. | 
|---|
| 381 | [java] ; Compiling C:\temp\abcl\abcl-src-0.12.0\build\classes\org\armedbear\lisp\coerce.lisp ... | 
|---|
| 382 | [java] ; (IN-PACKAGE #:SYSTEM) | 
|---|
| 383 | [java] ; (DECLAIM (FTYPE # ...)) | 
|---|
| 384 | [java] ; (DEFUN COERCE-LIST-TO-VECTOR ...) | 
|---|
| 385 | [java] ; (DECLAIM (FTYPE # ...)) | 
|---|
| 386 | [java] ; (DEFUN COPY-STRING ...) | 
|---|
| 387 | [java] ; (DEFUN COERCE-ERROR ...) | 
|---|
| 388 | [java] ; (DECLAIM (FTYPE # ...)) | 
|---|
| 389 | [java] ; (DEFUN COERCE-OBJECT-TO-AND-TYPE ...) | 
|---|
| 390 | [java] ; (DEFUN COERCE ...) | 
|---|
| 391 | [java] ; Wrote C:\temp\abcl\abcl-src-0.12.0\build\classes\org\armedbear\lisp\coerce.abcl (0.661 seconds) | 
|---|
| 392 | [java] ; Compiling C:\temp\abcl\abcl-src-0.12.0\build\classes\org\armedbear\lisp\open.lisp ... | 
|---|
| 393 | [java] ; (IN-PACKAGE #:SYSTEM) | 
|---|
| 394 | [java] ; (DEFUN UPGRADED-ELEMENT-TYPE-BITS ...) | 
|---|
| 395 | [java] ; (DEFUN UPGRADED-ELEMENT-TYPE ...) | 
|---|
| 396 | [java] ; (DEFUN OPEN ...) | 
|---|
| 397 | [java] ; Wrote C:\temp\abcl\abcl-src-0.12.0\build\classes\org\armedbear\lisp\open.abcl (0.641 seconds) | 
|---|
| 398 | [java] ; Compiling C:\temp\abcl\abcl-src-0.12.0\build\classes\org\armedbear\lisp\dump-form.lisp ... | 
|---|
| 399 | [java] ; (IN-PACKAGE "SYSTEM") | 
|---|
| 400 | [java] ; (DECLAIM (FTYPE # ...)) | 
|---|
| 401 | [java] ; (DEFUN DUMP-CONS ...) | 
|---|
| 402 | [java] ; (DECLAIM (FTYPE # ...)) | 
|---|
| 403 | [java] ; (DEFUN DUMP-VECTOR ...) | 
|---|
| 404 | [java] ; (DECLAIM (FTYPE # ...)) | 
|---|
| 405 |  | 
|---|
| 406 | ... | 
|---|
| 407 | lots and lots of output here | 
|---|
| 408 | ... | 
|---|
| 409 |  | 
|---|
| 410 | [java] ; (DEFMACRO WITH-SLOTS ...) | 
|---|
| 411 | [java] ; Wrote C:\temp\abcl\abcl-src-0.12.0\build\classes\org\armedbear\lisp\with-slots.abcl (0.11 seconds) | 
|---|
| 412 | [java] ; Compiling C:\temp\abcl\abcl-src-0.12.0\build\classes\org\armedbear\lisp\with-standard-io-syntax.lisp ... | 
|---|
| 413 | [java] ; (IN-PACKAGE "SYSTEM") | 
|---|
| 414 | [java] ; (DEFUN %WITH-STANDARD-IO-SYNTAX ...) | 
|---|
| 415 | [java] ; (DEFMACRO WITH-STANDARD-IO-SYNTAX ...) | 
|---|
| 416 | [java] ; Wrote C:\temp\abcl\abcl-src-0.12.0\build\classes\org\armedbear\lisp\with-standard-io-syntax.abcl (0.131 seconds) | 
|---|
| 417 | [java] ; Compiling C:\temp\abcl\abcl-src-0.12.0\build\classes\org\armedbear\lisp\with-thread-lock.lisp ... | 
|---|
| 418 | [java] ; (IN-PACKAGE "EXTENSIONS") | 
|---|
| 419 | [java] ; (DEFMACRO WITH-THREAD-LOCK ...) | 
|---|
| 420 | [java] ; Wrote C:\temp\abcl\abcl-src-0.12.0\build\classes\org\armedbear\lisp\with-thread-lock.abcl (0.08 seconds) | 
|---|
| 421 | [java] ; Compiling C:\temp\abcl\abcl-src-0.12.0\build\classes\org\armedbear\lisp\write-sequence.lisp ... | 
|---|
| 422 | [java] ; (IN-PACKAGE #:SYSTEM) | 
|---|
| 423 | [java] ; (DEFUN WRITE-SEQUENCE ...) | 
|---|
| 424 | [java] ; Wrote C:\temp\abcl\abcl-src-0.12.0\build\classes\org\armedbear\lisp\write-sequence.abcl (0.09 seconds) | 
|---|
| 425 | [java] 283.678 seconds real time | 
|---|
| 426 | [java] 71118074 cons cells | 
|---|
| 427 |  | 
|---|
| 428 | abcl.compile: | 
|---|
| 429 | [echo] Compiled ABCL with java version: 1.6.0_03 | 
|---|
| 430 |  | 
|---|
| 431 | abcl.stamp: | 
|---|
| 432 |  | 
|---|
| 433 | abcl.pre-compile: | 
|---|
| 434 | [echo] java.version: 1.6.0_03 | 
|---|
| 435 |  | 
|---|
| 436 | abcl.copy.lisp: | 
|---|
| 437 |  | 
|---|
| 438 | abcl.java.warning: | 
|---|
| 439 | [echo] WARNING: Java version 1.6.0_03 not recommended. | 
|---|
| 440 |  | 
|---|
| 441 | abcl.compile.java: | 
|---|
| 442 |  | 
|---|
| 443 | abcl.fasls.uptodate: | 
|---|
| 444 |  | 
|---|
| 445 | abcl.compile.lisp: | 
|---|
| 446 |  | 
|---|
| 447 | abcl.compile: | 
|---|
| 448 | [echo] Compiled ABCL with java version: 1.6.0_03 | 
|---|
| 449 |  | 
|---|
| 450 | abcl.stamp.version: | 
|---|
| 451 | [echo] Building ABCL version: 0.12.0 | 
|---|
| 452 |  | 
|---|
| 453 | abcl.stamp.hostname: | 
|---|
| 454 | [echo] abcl.hostname: IBM-D396A533B48 | 
|---|
| 455 |  | 
|---|
| 456 | abcl.jar: | 
|---|
| 457 | [jar] Building jar: C:\temp\abcl\abcl-src-0.12.0\dist\abcl.jar | 
|---|
| 458 |  | 
|---|
| 459 | BUILD SUCCESSFUL | 
|---|
| 460 | Total time: 6 minutes 6 seconds | 
|---|
| 461 | C:\temp\abcl\abcl-src-0.12.0> | 
|---|
| 462 | </pre> | 
|---|
| 463 | <p> | 
|---|
| 464 | The last line of output is our target file: | 
|---|
| 465 | <tt>C:\temp\abcl\abcl-src-0.12.0\dist\abcl.jar</tt>. This is actually quite an | 
|---|
| 466 | intelligent JAR file, as it knows the name of the main Java class to run. This | 
|---|
| 467 | means quite a lot of the complexity of actually running the application is | 
|---|
| 468 | hidden from the user. So we can run the JAR file from the command line, using | 
|---|
| 469 | <tt>java.exe</tt> with only its <tt>-jar</tt> option: | 
|---|
| 470 | </p> | 
|---|
| 471 |  | 
|---|
| 472 | <pre> | 
|---|
| 473 | C:\temp\abcl\abcl-src-0.12.0>dir C:\temp\abcl\abcl-src-0.12.0\dist\abcl.jar | 
|---|
| 474 | Volume in drive C has no label. | 
|---|
| 475 | Volume Serial Number is 7DDF-ABBD | 
|---|
| 476 |  | 
|---|
| 477 | Directory of C:\temp\abcl\abcl-src-0.12.0\dist | 
|---|
| 478 |  | 
|---|
| 479 | 23/02/2009  14:41         5,634,488 abcl.jar | 
|---|
| 480 | 1 File(s)      5,634,488 bytes | 
|---|
| 481 | 0 Dir(s)  11,169,034,240 bytes free | 
|---|
| 482 |  | 
|---|
| 483 | C:\temp\abcl\abcl-src-0.12.0>java -jar C:\temp\abcl\abcl-src-0.12.0\dist\abcl.jar | 
|---|
| 484 | Armed Bear Common Lisp 0.12.0 | 
|---|
| 485 | Java 1.6.0_05 Sun Microsystems Inc. | 
|---|
| 486 | Java HotSpot(TM) Client VM | 
|---|
| 487 | Low-level initialization completed in 2.413 seconds. | 
|---|
| 488 | Startup completed in 6.519 seconds. | 
|---|
| 489 | Type ":help" for a list of available commands. | 
|---|
| 490 | CL-USER(1): | 
|---|
| 491 | </pre> | 
|---|
| 492 | <p>Winner! We now have a working version of ABCL. Put the JAR file on a memory | 
|---|
| 493 | stick or CD and you have your own personal Lisp system available to you where | 
|---|
| 494 | ever you are. Now how cool is that? | 
|---|
| 495 | </p> | 
|---|
| 496 |  | 
|---|
| 497 | <a name="linux"></a><a href="#top">top</a> | 
|---|
| 498 | <h2>Running ABCL on Linux</h2> | 
|---|
| 499 | <p> | 
|---|
| 500 | Because ABCL is a Java application, it should in theory be possible to run this | 
|---|
| 501 | on any computer where the Java Virtual Machine (JVM) is installed. However, if | 
|---|
| 502 | you wish to run this on Linux you need to perform the following actions to | 
|---|
| 503 | allow ABCL to run correctly. If you just run the JAR file, then you will find | 
|---|
| 504 | the arrow keys (ie up, down, left and right) do not function correctly. | 
|---|
| 505 | Instead, you get output as shown below (here the keys entered were, in order, | 
|---|
| 506 | up, right, down, and left): | 
|---|
| 507 | </p> | 
|---|
| 508 |  | 
|---|
| 509 | <pre> | 
|---|
| 510 | Armed Bear Common Lisp 0.12.0 | 
|---|
| 511 | Java 1.6.0 IBM Corporation | 
|---|
| 512 | IBM J9 VM | 
|---|
| 513 | Low-level initialization completed in 0.718 seconds. | 
|---|
| 514 | Startup completed in 2.411 seconds. | 
|---|
| 515 | Type ":help" for a list of available commands. | 
|---|
| 516 | CL-USER(1): ^[[A^[[C^[[B^[[D | 
|---|
| 517 | </pre> | 
|---|
| 518 |  | 
|---|
| 519 | <p> | 
|---|
| 520 | Here you can see that you are not getting the correct response. You need to | 
|---|
| 521 | get the tool <a href="http://utopia.knoware.nl/~hlub/rlwrap/">rlwrap</a>. To | 
|---|
| 522 | use this you need to first install the software. Download the source code, the | 
|---|
| 523 | current version of which is in | 
|---|
| 524 | <a href="http://utopia.knoware.nl/~hlub/rlwrap/rlwrap-0.30.tar.gz"> | 
|---|
| 525 | rlwrap-0.30.tar.gz</a>. Extract the contents to your system. For example, if | 
|---|
| 526 | you want to extract into <tt>/tmp</tt> save the file to somewhere on your | 
|---|
| 527 | system, and then run this command: | 
|---|
| 528 | </p> | 
|---|
| 529 |  | 
|---|
| 530 | <pre> | 
|---|
| 531 | cd /tmp | 
|---|
| 532 | tar zxvf /path/to/rlwrap-0.30.tar.gz | 
|---|
| 533 | </pre> | 
|---|
| 534 |  | 
|---|
| 535 | <p> | 
|---|
| 536 | In this case it will create the directory <tt>/tmp/rlwrap-0.30.tar.gz</tt> | 
|---|
| 537 | To perform the remaining commands you should <tt>su</tt> to root. This will then | 
|---|
| 538 | allow you to intall the binary in <tt>/usr/local/bin</tt>. Run the following | 
|---|
| 539 | commands as root: | 
|---|
| 540 | </p> | 
|---|
| 541 | <pre> | 
|---|
| 542 | cd /tmp/rlwrap-0.30 | 
|---|
| 543 | ./configure | 
|---|
| 544 | make | 
|---|
| 545 | make install | 
|---|
| 546 | </pre> | 
|---|
| 547 |  | 
|---|
| 548 |  | 
|---|
| 549 | <p> | 
|---|
| 550 | Now we need to create the file <tt>.abcl_completions</tt>. To do this save | 
|---|
| 551 | the following Lisp code to a file, say <tt>test.lisp</tt>: | 
|---|
| 552 | </p> | 
|---|
| 553 |  | 
|---|
| 554 | <pre> | 
|---|
| 555 | (defvar symbols nil) | 
|---|
| 556 |  | 
|---|
| 557 | (do-all-symbols (sym) | 
|---|
| 558 | (let ((package (symbol-package sym))) | 
|---|
| 559 | (cond | 
|---|
| 560 | ((not (fboundp sym))) | 
|---|
| 561 | ((or (eql #.(find-package :cl) package) | 
|---|
| 562 | (eql #.(find-package :extensions) package) | 
|---|
| 563 | (eql #.(find-package :cl-user) package)) | 
|---|
| 564 | (pushnew (symbol-name sym) symbols)) | 
|---|
| 565 | ((eql #.(find-package :keyword) package) | 
|---|
| 566 | (pushnew (concatenate 'string ":" (symbol-name sym)) symbols)) | 
|---|
| 567 | (package | 
|---|
| 568 | (pushnew (concatenate 'string | 
|---|
| 569 | (package-name package) | 
|---|
| 570 | ":" | 
|---|
| 571 | (symbol-name sym)) | 
|---|
| 572 | symbols))))) | 
|---|
| 573 | (with-open-file (output #.(concatenate 'string | 
|---|
| 574 | (getenv "HOME") | 
|---|
| 575 | "/.abcl_completions") | 
|---|
| 576 | :direction :output :if-exists :overwrite | 
|---|
| 577 | :if-does-not-exist :create) | 
|---|
| 578 | (format output "~{~(~A~)~%~}" (sort symbols #'string<))) | 
|---|
| 579 | (quit)) | 
|---|
| 580 | </pre> | 
|---|
| 581 |  | 
|---|
| 582 | <p> | 
|---|
| 583 | Now create the <tt>.abcl_completions</tt> by running this command: | 
|---|
| 584 | </p> | 
|---|
| 585 |  | 
|---|
| 586 | <pre> | 
|---|
| 587 | java -jar abcl.jar --load test.lisp | 
|---|
| 588 | </pre> | 
|---|
| 589 |  | 
|---|
| 590 | <p> | 
|---|
| 591 | The final <tt>(quit)</tt> ensures this Lisp command returns you to the | 
|---|
| 592 | command line when it completes. It creates the <tt>.abcl_completions</tt> | 
|---|
| 593 | file in your home directory. We still need to do one more thing, before we | 
|---|
| 594 | create the <tt>lisp</tt> executable. If you need to know the path to the | 
|---|
| 595 | <tt>abcl.jar</tt> file If you don't know what it is you can search for it: | 
|---|
| 596 | </p> | 
|---|
| 597 |  | 
|---|
| 598 | <pre> | 
|---|
| 599 | find / 2>/dev/null -name abcl.jar | 
|---|
| 600 | </pre> | 
|---|
| 601 |  | 
|---|
| 602 | <p> | 
|---|
| 603 | If this does not return any names, try replacing <tt>abcl.jar</tt> with | 
|---|
| 604 | <tt>abcl\*.jar</tt>, as the JAR file may have a version number included. | 
|---|
| 605 | Consider that the filename returned is <tt>/opt/abcl/abcl.jar</tt>, then we will | 
|---|
| 606 | need the line <tt>ABCL_JAR=/opt/abcl/abcl.jar</tt> in our script. So bearing | 
|---|
| 607 | this in mind, we can now create a script file that we can call | 
|---|
| 608 | <tt>/usr/local/bin/lisp</tt>: | 
|---|
| 609 | </p> | 
|---|
| 610 |  | 
|---|
| 611 | <pre> | 
|---|
| 612 | #!/bin/sh | 
|---|
| 613 | ABCL_JAR=/opt/abcl/abcl.jar # Use your own path here. | 
|---|
| 614 | JAVA=$(which java) | 
|---|
| 615 | ABCL="$JAVA -server -Xrs -cp $ABCL_JAR org.armedbear.lisp.Main" | 
|---|
| 616 | if [ $# -eq 0 ]; then | 
|---|
| 617 | exec rlwrap -b "[]()'\" " --remember -c -f ~/.abcl_completions \ | 
|---|
| 618 | -H ~/.abcl_history -s 1000000 $ABCL | 
|---|
| 619 | else | 
|---|
| 620 | exec $ABCL "$@" | 
|---|
| 621 | fi | 
|---|
| 622 | </pre> | 
|---|
| 623 |  | 
|---|
| 624 | <p> | 
|---|
| 625 | Now when you use this <tt>lisp</tt> command you will get the keystroke behaviour | 
|---|
| 626 | you expect. | 
|---|
| 627 | </p> | 
|---|
| 628 |  | 
|---|
| 629 | <a href="#top">top</a> | 
|---|
| 630 | <a href="http://common-lisp.net/project/armedbear/">home</a> | 
|---|
| 631 | </body> | 
|---|
| 632 | </html> | 
|---|