[armedbear-devel] Building with Netbeans

Mark Evenson evenson at panix.com
Fri Feb 12 08:01:41 UTC 2010


On 2/11/10 7:45 PM, Paul Griffioen wrote:
[…]

> I work with Netbeans 6.8 (just upgraded for ANT) and run the build from
> the menu. Running the generated jar with 'java -jar abcl.jar geeft'
> gives the following message:
>
> Failed to load Main-Class manifest attribute from
> abcl.jar
>
> I noticed that the manifest.mf just contains the following:
>
> Manifest-Version: 1.0
> Ant-Version: Apache Ant 1.7.1
> Created-By: 1.6.0_0-b11 (Sun Microsystems Inc.)
> Class-Path:
>
> Is the Netbeans build supposed to work? Does anybody have any idea why
> the Main is not in the generated manifest?

Yep:  you have found a bug.  We use Netbeans for interactive debugging, 
but typically do final packaging of ABCL by running the Ant task 
'abcl.jar', which is unfortunately a different code path than the way 
Netbeans generates the file.  Although Netbeans creates 'dist/abcl.jar' 
it never uses it itself, instead using the buildpath elements, so we 
hadn't really tested the Netbeans produced JAR.

I've applied a fix to make the Netbeans produced JAR runnable in [][1]

[1]:

> A second question is what the best way is to include the jna library.
> I'm trying to compile CFFI with ABCL but that required jna as the
> following quote from CFFI's code shows:
>
> ;;; This implementation requires the Java Native Access (JNA) library.
> ;;; <http://jna.dev.java.net/>
>
> I downloaded the required jna.jar and figured that I could include it
> somehow in abcl.jar after building that. Unfortunately that build failed
> but I would like to be able to use it from Netbeans anyway. Does anybody
> know how to do that? My knowledge of the Java ecosystem is limited so
> figuring this out for ABCL specifically is not easy.

Which CFFI?  I know that Luís Olivera had created some patches last 
Summer, but I didn't know if they had been merged back into the CFFI 
main distribution.  Fleshing out his implementation (it was missing 
callbacks) is one of my many todo items.  I'd be interested in hearing 
your experience with CFFI in ABCL (when you get some!)

Incorporating additional JAR files in the Netbeans build involves 1) 
Opening  the project properties dialog by choosing "File >> Project 
Properties" from the main menu bar.  2) Under categories choosing 
"Libraries".  3) Choosing "Run"  from the type of libraries.  4) Choose 
"Add JAR/Folder".  5) Using the file chooser to point to the local path 
of 'jna.jar'.

But I would recommed using the external Ant script to produce the 
executable wrapper.  In addition to using the "blessed" build procedure 
(or at least the well-tested one), we have a simpler mechanism to 
exclude additional JAR files on the ABCL runtime classpath:  simply 
create a top-level file named 'build.properties'.  There is an example 
'build.properties.in' that can be copied for a start.  Then create a 
property entry like

	additional.jars=../../path/to/jna.jar

Then invoking

	cmd$ ant abcl.wrapper

from the command line will create an 'abcl' (or 'abcl.bat' under 
Windows) script that will automatically include the JAR files on the 
ABCL runtime  path.




>
> Finally I would appreciate feedback on the following patch for
> TRIVIAL-FEATURES I needed to write to get CFFI to compile. It turned out
> that the endianess feature wasn't set.
>
> diff -rN old-trivial-features/src/tf-abcl.lisp
> new-trivial-features/src/tf-abcl.lisp
> 31c31,38
> < ;;; TODO
> ---
>  > (pushnew (let ((order (jcall "toString"
>  >                              (jstatic "nativeOrder"
> "java.nio.ByteOrder"))))
>  >            (cond ((string-equal order "LITTLE_ENDIAN")
>  >                   :little-endian)
>  >                  ((string-equal order "BIG_ENDIAN")
>  >                   :big-endian)
>  >                  (t (error "Byte order ~A unknown" order))))
>  >          *features*)
>
> Like I said, I'm no Java expert and feedback would be helpful.
>
> Any comment, help or pointers would be appreciated.
>
> Paul
>
>
>
> _______________________________________________
> armedbear-devel mailing list
> armedbear-devel at common-lisp.net
> http://common-lisp.net/cgi-bin/mailman/listinfo/armedbear-devel


-- 
"A screaming comes across the sky.  It has happened before, but there
is nothing to compare to it now."




More information about the armedbear-devel mailing list