Run a JGNAT program?
        Posted  
        
            by 
                anta40
            
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by anta40
        
        
        
        Published on 2011-01-13T16:50:57Z
        Indexed on 
            2011/01/13
            16:53 UTC
        
        
        Read the original article
        Hit count: 503
        
I just installed JGNAT on Windows (gnat-gpl-2010-jvm-bin.exe)
This is a sample code hello.adb from the included manual:
with Ada.Text_IO; use Ada.Text_IO;
 procedure Hello is
 begin
    Put_Line ("Hello GNAT for the JVM.");
 end Hello;
First, compile it: jvm-gnatmake hello.adb
jvm-gnatcompile -c hello.adb
jvm-gnatbind -x hello.ali
jvm-gnatlink hello.ali
Looks fine. So let's run it: java hello
Exception in thread "main" java.lang.NoClassDefFoundError: jgnat/adalib/GNAT_libc
    at hello.main(hello.adb)
Caused by: java.lang.ClassNotFoundException: jgnat.adalib.GNAT_libc
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 1 more
Any idea why?
© Stack Overflow or respective owner