

- #Ultraedit scripts how to
- #Ultraedit scripts install
- #Ultraedit scripts code
- #Ultraedit scripts download
I won’t say much about the implementation of Lua in C\C.
#Ultraedit scripts how to
What I want to say is how to use Lua in Java to improve programming efficiency and enhance your program scalability.įirst of all, to use Lua scripts on Java, there must be related APIs about Lua script interpreters and Java programs that can access these scripts, that is, related class libraries.
#Ultraedit scripts code
Luajava-1.1.jar is easy, just add it to the ClassPath of your project so that the program can use the API it provides You can find LuaJava's class library and source code at:, use documentation, etc.Īfter downloading and decompressing, it includes two files (I downloaded version 1.1): luajava-1.1.jar file and luajava-1.1.dll dynamic link library file I am using an open source project called LuaJava. You must add it to your Windows installation directory.
#Ultraedit scripts install
Well, now your project can use Lua scripts to implement dynamic expansion functions! But don't worry, you have to have tools to write Lua scripts, right? It’s impossible to write in a notepad, right? Of course you You can also add it to the jre under your JDK For example, if you are using XP and install it on the C drive, then add it directly to the C:\WINDOWS directory. You can use UltraEdit, but after you open the lua file with UE, you will find that it is similar to Notepad, and it is not highlighted (maybe the new version supports Lua scripts).



#Ultraedit scripts download
If your UE does not support it, then go to UltraEdit's official website to download The Wordfiles file ( ) that supports Lua is a text file (lua.txt). Syntax highlighting support for other languages is similar.īut if you are a Java developer, have you all used Eclipse? Can I write Lua scripts directly under Eclipse? The answer is yes! Open the wordfile.txt in the installation directory of UltraEdit, copy and paste the contents of the lua.txt file to the end of wordfile.txt, save it, and OK, so the syntax highlighting item of UltraEdit is more than Lua, and you can choose to use it. This is of course the powerful plug-in management function of Eclipse. Okay, now everything is ready, let's have a HelloWorld!įirst create a TestLua project in Eclipse, and then write the following program: Pay attention to setting the properties of LUA in the preferences (I don't need to say if Eclipse installs the plug-in?) You can download the luaeclipse plug-in to make your Eclipse have the ability to write Lua scripts (you can highlight your scripts, isn’t it cool?), you can go here Download: Īfter downloading and installing, your Eclipse can create and write Lua scripts. ("Here is the Java program calling Lua script") LuaState L = LuaStateFactory.newLuaState() Well, the program is finished, of course it is saved as Hello.java. = luajava.newInstance("java.awt.", "Lua Java Console")Ĭonsole = luajava.newInstance("")īuttons_pn = luajava.newInstance("")Įxecute_bt = luajava.newInstance("", "Execute")Ĭlear_bt = luajava.newInstance("", "Clear")Įxit_bt = luajava.newInstance("", "Exit")īorderLayout = luajava.bindClass("") Isn't it cool? Feeling boring? Okay, let's come to a script: Here is the Java program calling Lua script You can compile and execute the Hello.java program, and you will see the following output: Okay, if you don’t know what the above script means, it’s okay, just run it Print("Let us feel the wonder of it together!\n") Print("You are using the LUA scripting language") Below is the content of this script file (you can copy them directly to your a file): Note that this is Java code! This is the Java code calling a script called a.
