lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


First you need to create a JNI header by running:

javah -classpath .. -jni luajava.API

At your LuaJava directory. Then compile both lua3.c and luajava_API.c. In my
machine (JDK 1.3, VC++ 7 compiler) I used:

cl /c /O2 /Ic:\lua4\include\ /I. /Ic:\jdk1.3\include
/Ic:\jdk1.3include\win32 lua3.c luajava_API.c

You must also have previously created a lua.lib from the .c files in the Lua
src directory and a lualib.lib from the .c files in the src\lib directory.
Again, in my system:

c:\lua4\src> cl /c /O2 /I..\include *.c
c:\lua4\src> link /lib /out:lua.lib *.obj

c:\lua4\src\lib> cl /c /O2 /I..\..\include *.c
c:\lua4\src\lib> link /lib /out:lualib.lib *.obj

Copy lua.lib and lualib.lib to the LuaJava directory and do:

link /dll /out:luajava_API.dll lua3.c luajava_API.obj lua.lib lualib.lib

This will create luajava_API.dll. Put it in your PATH and you're done. The
steps are similar if you use BCC or gcc to compile, but the parameters
should be a little different.

Fabio Mascarenhas
mascarenhas@acm.org


----- Original Message -----
From: "jeremiah oneal" <cneal92@lycos.com>
To: <lua@bazar2.conectiva.com.br>
Sent: Saturday, May 31, 2003 9:22 PM
Subject: javalua


> Hi,
>
> I'm on a win98 machine and my version of java is 1.4.0?. I'm trying to
compile tests.java program that was part of javalua
(http://www.cis.upenn.edu/~cvogler/lua/luajava.html). When I do compile the
program and then run the program, I get this.
>
> Exception in thread "main" java.lang.UnsatisfiedLinkError: no luajava_API
in java.library.path
>         at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1410)
>         at java.lang.Runtime.loadLibrary0(Runtime.java:772)
>         at java.lang.System.loadLibrary(System.java:832)
>         at luajava.API.<clinit>(API.java:19)
>         at Tests.main(Tests.java:9)
> Press any key to continue . . .
>
>
> I have already figured out that the cause of this error is luajava_API.c.
I do have this file however I do not know where to put it or what I need to
do with it. Any help is apreciated.
>
> Thanks,
>
> - iCneal
>  cneal92@lycos.com
>
>
> ____________________________________________________________
> Get advanced SPAM filtering on Webmail or POP Mail ... Get Lycos Mail!
> http://login.mail.lycos.com/r/referral?aid=27005