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

----- Original Message -----
From: "jeremiah oneal" <>
To: <>
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 program that was part of javalua
( 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(
>         at java.lang.Runtime.loadLibrary0(
>         at java.lang.System.loadLibrary(
>         at luajava.API.<clinit>(
>         at Tests.main(
> 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
> ____________________________________________________________
> Get advanced SPAM filtering on Webmail or POP Mail ... Get Lycos Mail!