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