gclib uses the venerable Java Native Access (JNA) library to simplify integration into the Java Native Interface (JNI).
- Attention
- This is the initial version of the the gclib Java wrapper. As such, GclibJava ships as source files, not the compiled jar files. All functions are subject to change in future releases of gclib. Java hackers with recommendations on how to make this library better are encouraged to email suppo.nosp@m.rt@g.nosp@m.alil..nosp@m.com. Somebody has to teach those Galil Java noobs what's what.
Windows
The following instructions were performed with 64 bit Windows 7 on Oracle NetBeans IDE 8.2 and Java 1.8.0_131.
For brevity, these instructions assume the default gclib installation location of "C:\Program Files (x86)\Galil\gclib".
Step-by-Step
- Install gclib with 64 bit binaries (default install).
- Install 64 bit NetBeans and Java, jdk-8u131-nb-8_2-windows-x64.exe.
- Launch NetBeans.
- Create a new application.
- File | New Project...
- Under Categories, select Java.
- Under Projects, select Java Application.
- Click Next.
- Type
GclibTest
for the Project Name.
- Note the location of the Project Folder.
- Uncheck Create Main Class
- Click Finish
- Open the Project Folder as noted above.
- Open the src directory in the Project Folder location.
- Copy the whole directory C:\Program Files (x86)\Galil\gclib\examples\java\gclibtest to this directory.
- Copy the whole directory C:\Program Files (x86)\Galil\gclib\source\wrappers\java\gclibjava to this directory.
- Create a directory at
c:\jna\
.
- Another directory may be chosen. The purpose of this directory is to hold jna's jar binary for the Java classpath.
- Download a copy of jna.jar to the new directory.
- In the NetBeans Projects tab, expand GclibTest.
- Right-click on Libraries and choose Add JAR/Folder....
- Navigate to the jna.jar saved above. Click Open to add jna.jar to the classpath.
- In the NetBeans Projects tab, right-click on GclibTest and choose Properties.
- Choose the Run item out of the Categories options tree.
- In the Main Class text box, type
gclibtest.GclibTest
. Click OK.
- In the NetBeans Projects tab, expand GclibTest | Source Packages | gclibtest.
- Double click GclibTest.java, and find the line containing
gclib.GOpen
.
- Update the address for the desired hardware.
- Choose Run | Run Project (GclibTest) or hit the
F6
key to run the application.
- The appplication output will print in the NetBeans Output window.
Documentation
The GclibJava class has helpful documentation for developing a Java application. Use the following instructions to create the Javadoc.
- In the NetBeans Projects tab, right-click GclibTest.
- Choose Generate Javadoc to create the documentation and open it in the system's default browser.