LuaJ Runs In Different Scope #88

Closed
opened 2021-05-02 18:00:27 +00:00 by nikhilanayak · 0 comments
nikhilanayak commented 2021-05-02 18:00:27 +00:00 (Migrated from github.com)

In my Java code, I initialize a static variable called x with value 1. In Lua, I access a class using luajava.newInstance. When I call a function from that class, it is supposed to print x. However, it seems that x is not 1, it's 0. If I do this with an Object, it becomes null. Is this a feature? If it is, how can I use Java values from Java functions called from Lua?

In my Java code, I initialize a static variable called `x` with value `1`. In Lua, I access a class using `luajava.newInstance`. When I call a function from that class, it is supposed to print x. However, it seems that x is not 1, it's 0. If I do this with an Object, it becomes null. Is this a feature? If it is, how can I use Java values from Java functions called from Lua?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: open-autonomous-connection/luaj#88