NVRAM Free Webspace: Compiling leJOS under 64-bit Linux/title> <LINK rel="stylesheet" type="text/css" href="/fs_img/builder/builder103/style.css"> <SCRIPT language="Javascript"> function show( tag, img ) { var elem = document.getElementById(tag); if (!elem) { window.open(img, "", "width=800px, height=600px, resizable"); } else if (elem.style.display=='none') { elem.style.display = 'none'; } else if (null == elem.innerHTML.match("<img")) { elem.innerHTML = "<br/><img src='" + img + "'>"; elem.style.display = ''; } else { elem.innerHTML = ""; } } </SCRIPT> <style> a { color: cyan; } a.extra { color: #203300; background-color: #F5DFE0; } li.extra { color: black; border: 1px solid #003B62; font-family: verdana; background-color: #F5DFE0; font-size: 100%; } div.note{ color: black; border: 2px solid #003B62; font-family: verdana; background-color: #B5CFE0; font-size: 100%; padding: 5px 5px 8px 5px; margin: 10px 3em 10px 2em; } span.code{ color: black; border: 2px solid #003B62; font-family: verdana; background-color: #B5CFE0; padding: 7px; margin: 5px; font-size: 90%; } pre.code{ color: black; border: 2px solid #003B62; font-family: courier; background-color: #B5CFE0; font-size: 90%; padding: 5px 5px 8px 5px; margin: 10px 3em 10px 2em; } </style> </HEAD> <body id="body_index"> <script language="JavaScript"> var i, eDiv = document.getElementsByTagName("div"); for(i=0;i<eDiv.length;++i) eDiv[i].style.display = "none"; </script> <DIV id="mainarea" class="mainarea"> <H1 id="page_title">Building leJOS on 64-bit Linux</H1> <DIV id="linksarea"> <a class="menulinks" href="/index.html">Greetings</a> <a class="menulinks" href="/reply-to.html">"Reply-To"</a> <a class="menulinks" href="/lejos.html">Building leJOS under 64-bit Linux</a> </DIV> <h2>Introduction</h2> <div class="textarea"> <div> This page attempts to show how to compile <a target="_new" href="http://lejos.sf.net/">leJOS</a> on 64-bit Linux machines. It is a work in progress, so see the forums <a target="_new" href="http://lejos.sourceforge.net/forum" >http://lejos.sourceforge.net/forum</a> for updates and discussion. </div> <div> The initial problem is that, as of 0.4.0, the JNI sources and the ANT build script are only targeted at 32-bit systems. </div> <div> This is my attempt at a simple compilation for 64-bit Linux. </div> <ol style="list-style-type:upper-roman"> <li>Install the JDK somewhere on your machine and set an environment variable <strong>JAVA_HOME</strong> to its base. </li> <li>Set an environment variable <strong>JAVA_HOME</strong> to its base. </li> <li>Make sure that you read through the <a class="extra" href="http://lejos.sourceforge.net/forum/viewtopic.php?t=236" >leJOS NXJ FAQ</a>. </li> <li>Look through the revised <a href="http://www.variantpress.com/file_download/5">installation instructions</a>, but note that: <ul> <li>You need a <strong>32-bit (386) version</strong> of libusb, the base package and <strong>*-devel</strong> package.</li> <li>If you get missing file errors for "bluetooth.h" then verify that you have the base and <strong>*-devel</strong> Bluetooth packages installed (possibly named <strong>bluez<strong> or <strong>libbluetooth</strong>).</li> </ul> <ol> <li>Download and decompress the tar file from www.lejos.org.</li> <li>Add the environment variable NXJ_HOME and set it to the directory you installed leJOS.</li> <li>Add the leJOS bin directory to your PATH. Depending on the privilege settings, you might need to adjust the execution permissions in the bin folder.</li> <li>Your PATH must also contain the ant binary (ant 1.6 or above).</li> <li>You need libusb installed so the leJOS tools can access your USB port. This can be downloaded from: <a href="http://libusb.sourceforge.net" >http://libusb.sourceforge.net</a> <br/><div class="note">Search for a package for your OS distribution first, and make sure to get 32-bit (386) versions and the <em>-devel</em> version, too. </li> <li class="extra">Create an executable shell script named <strong>gcc</strong> in the <strong>build</strong> sub-directory of leJOS: <pre class='code'> cd $NXJ_HOME/build echo '#!/bin/bash -x' > gcc echo 'inc=${JAVA_HOME}/include' >> gcc echo 'export C_INCLUDE_PATH=.:$inc:$inc/linux' >> gcc echo 'export PATH=${JAVA_HOME}/bin:$PATH' >> gcc echo 'exec /usr/bin/gcc -m32 "$@"' >> gcc chmod +x ./gcc</pre> <em>NOTE: Change the last line if needed:</em><ul> <li>Add <strong>-v</strong> (before <strong>-m32</strong>) if you are having problems and want to see what GCC is doing in more detail,</li> <li>Change the path to GCC if needed. To check, use: <strong>type gcc</strong></li> </ul> </li> <li class="extra">Prepend your <strong>PATH</strong> with the new shell script, and build: <pre class="code"> export PATH=$PWD:$PATH ant build</pre> </li> <li>Now you need to build the distribution. Switch to the build folder and run ant. Note that depending on the privilege settings you might need to adjust the execution permissions in the release folder.</li> </li> </nl> </body> </html> <!-- PrintTracker Insertion Begin --> <script src="/fs_img/js/pt.js" type="text/javascript"></script> <!-- PrintTracker Insertion Complete --> <!-- Google Analytics Insertion Begin --> <script type="text/javascript"> <!-- var _gaq = _gaq || []; _gaq.push(['_setAccount', "UA-4601892-4"]); _gaq.push(['_setDomainName', 'none']); _gaq.push(['_setAllowLinker', true]); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); --> </script> <!-- Google Analytics Insertion Complete -->