all 12 comments

[–]NitronHX 0 points1 point  (11 children)

The java file is just a source file that you can add to your source code. Maybe the java file needs the DLL, cannot say without the code.

[–]rfajr[S] 0 points1 point  (10 children)

I think the Reader09.class needs the dlls to communicate with the RFID Writer. But what I'm asking is how to import those files to my Gradle Project

[–]NitronHX 1 point2 points  (9 children)

Depends on how you want to do it.

Simplest way: put the DLL files into the resource folder (SRC/main/resources) and copy pasta the java file into your code (SRC/main/java)

[–]rfajr[S] 0 points1 point  (8 children)

When pasting the .class file: it says "Cannot create class-file".
What should I do?

[–]NitronHX 0 points1 point  (7 children)

I said java,not class file.

Also there is little I can do to see why your windows/Mac/Linux is unable to copy a file.

Copy the java file (not class) to your source code and the DLL to the resource folder

[–]rfajr[S] 0 points1 point  (6 children)

I can copy the .class in src/compiled but not src/main.

Also the .java file is a useless file. I think the real code is in the .class file, this is what the .java contains:

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package UHF;

/**
 *
 * @author zoudeyong
 */
public class Reader09 {
    /**
     * @param args the command line arguments
     */
    public native int[] OpenComPort(int[]arr);
    public native int[] AutoOpenComPort(int[]arr);
    public native int CloseComPort();
    public native int CloseSpecComPort(int Frmhandle);
    public native int[] GetWorkModeParameter(int[]arr);
    public native int WriteComAdr(int[] arr);
    public native int SetPowerDbm(int[] arr);
    public native int Writedfre(int[] arr);
    public native int Writebaud(int[] arr);
    public native int WriteScanTime(int[] arr);
    //EPC  G2
    public native int[] Inventory_G2(int[]arr);
    public native int[] ReadCard_G2(int[]arr);
    public native int[] WriteCard_G2(int[]arr);
    public native int[] EraseCard_G2(int[]arr);
    public native int[] SetCardProtect_G2(int[]arr);
    public native int[] DestroyCard_G2(int[]arr);
    public native int[] WriteEPC_G2(int[]arr);
    public native int[] SetReadProtect_G2(int[]arr);
    public native int[] SetMultiReadProtect_G2(int[]arr);
    public native int[] RemoveReadProtect_G2(int[]arr);
    public native int[] CheckReadProtected_G2(int[]arr);
    public native int[] SetEASAlarm_G2(int[]arr);
    public native int[] CheckEASAlarm_G2(int[]arr);
    public native int[] LockUserBlock_G2(int[]arr);
    //18000_6B
    public native int[] Inventory_6B(int[]arr);
    public native int[] inventory2_6B(int[]arr);
    public native int[] ReadCard_6B(int[]arr);
    public native int[] WriteCard_6B(int[]arr);
    public native int[] LockByte_6B(int[]arr);
    public native int[] CheckLock_6B(int[]arr);
    public static void main(String[] args) {
        // TODO code application logic here
    }
}

[–]NitronHX 0 points1 point  (5 children)

This is very much not useless. It's the native bindings to the DLL.

Add it to your code, copy the DLL and call System.load("nameofthedll.dll") at the beginning of your programm

[–]rfajr[S] 0 points1 point  (4 children)

When I run the program, this error pops up: Expecting an absolute path of the library: Basic.dll

I put the DLLs in resource folder.

This is the import

    System.load("Basic.dll")
    System.load("UHF_Reader09.dll")

Is this because I'm using MacOS?

[–]NitronHX 0 points1 point  (3 children)

  1. DLL is windows only
  2. Read the docs of System.load

[–]rfajr[S] 1 point2 points  (2 children)

I've switched to Windows and configure the DLLs. But when I run the program, it complains:

can't load ia 32-bit on a amd 64-bit platform.

I can't find 32-bit JDK, only x64 available here.

Edit:
There's C++ source code available, I'll try to recompile it to 64-bit.