OpenSerbianEID / ePorezi

ePorezi application mod to run on MacOS/Linux
30 stars 6 forks source link

Instructions for building from source? #10

Closed SergeiPatiakin closed 1 year ago

SergeiPatiakin commented 1 year ago

I am trying to build the application from source. I have installed Java 8 and Ant, but running ant compile gives the following error:

Mac2:~/pr/ePorezi% ant compile       
Buildfile: /Users/sergei/pr/ePorezi/build.xml

compile:
    [javac] /Users/sergei/pr/ePorezi/build.xml:15: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
    [javac] Compiling 27 source files to /Users/sergei/pr/ePorezi/out/production/ePorezi
    [javac] /Users/sergei/pr/ePorezi/com/itsinbox/smartbox/model/PKCS11Card.java:6: error: package sun.security.pkcs11 is not visible
    [javac] import sun.security.pkcs11.SunPKCS11;
    [javac]                    ^
    [javac]   (package sun.security.pkcs11 is declared in module jdk.crypto.cryptoki, which is not in the module graph)
    [javac] /Users/sergei/pr/ePorezi/com/itsinbox/smartbox/utils/WinRegistry.java:70: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
    [javac]          regCloseKey.invoke(systemRoot, new Integer(ret[0]));
    [javac]                                         ^
    [javac] /Users/sergei/pr/ePorezi/com/itsinbox/smartbox/utils/WinRegistry.java:77: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
    [javac]          regCloseKey.invoke(userRoot, new Integer(ret[0]));
    [javac]                                       ^
    [javac] /Users/sergei/pr/ePorezi/com/itsinbox/smartbox/utils/WinRegistry.java:125: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
    [javac]       int[] handles = (int[])regOpenKey.invoke(root, new Integer(hkey), toCstr(key), new Integer(983103));
    [javac]                                                      ^
    [javac] /Users/sergei/pr/ePorezi/com/itsinbox/smartbox/utils/WinRegistry.java:125: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
    [javac]       int[] handles = (int[])regOpenKey.invoke(root, new Integer(hkey), toCstr(key), new Integer(983103));
    [javac]                                                                                      ^
    [javac] /Users/sergei/pr/ePorezi/com/itsinbox/smartbox/utils/WinRegistry.java:129: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
    [javac]          int rc = (Integer)regDeleteValue.invoke(root, new Integer(handles[0]), toCstr(value));
    [javac]                                                        ^
    [javac] /Users/sergei/pr/ePorezi/com/itsinbox/smartbox/utils/WinRegistry.java:130: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
    [javac]          regCloseKey.invoke(root, new Integer(handles[0]));
    [javac]                                   ^
    [javac] /Users/sergei/pr/ePorezi/com/itsinbox/smartbox/utils/WinRegistry.java:136: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
    [javac]       int rc = (Integer)regDeleteKey.invoke(root, new Integer(hkey), toCstr(key));
    [javac]                                                   ^
    [javac] /Users/sergei/pr/ePorezi/com/itsinbox/smartbox/utils/WinRegistry.java:141: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
    [javac]       int[] handles = (int[])regOpenKey.invoke(root, new Integer(hkey), toCstr(key), new Integer(131097));
    [javac]                                                      ^
    [javac] /Users/sergei/pr/ePorezi/com/itsinbox/smartbox/utils/WinRegistry.java:141: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
    [javac]       int[] handles = (int[])regOpenKey.invoke(root, new Integer(hkey), toCstr(key), new Integer(131097));
    [javac]                                                                                      ^
    [javac] /Users/sergei/pr/ePorezi/com/itsinbox/smartbox/utils/WinRegistry.java:145: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
    [javac]          byte[] valb = (byte[])regQueryValueEx.invoke(root, new Integer(handles[0]), toCstr(value));
    [javac]                                                             ^
    [javac] /Users/sergei/pr/ePorezi/com/itsinbox/smartbox/utils/WinRegistry.java:146: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
    [javac]          regCloseKey.invoke(root, new Integer(handles[0]));
    [javac]                                   ^
    [javac] /Users/sergei/pr/ePorezi/com/itsinbox/smartbox/utils/WinRegistry.java:153: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
    [javac]       int[] handles = (int[])regOpenKey.invoke(root, new Integer(hkey), toCstr(key), new Integer(131097));
    [javac]                                                      ^
    [javac] /Users/sergei/pr/ePorezi/com/itsinbox/smartbox/utils/WinRegistry.java:153: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
    [javac]       int[] handles = (int[])regOpenKey.invoke(root, new Integer(hkey), toCstr(key), new Integer(131097));
    [javac]                                                                                      ^
    [javac] /Users/sergei/pr/ePorezi/com/itsinbox/smartbox/utils/WinRegistry.java:157: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
    [javac]          int[] info = (int[])regQueryInfoKey.invoke(root, new Integer(handles[0]));
    [javac]                                                           ^
    [javac] /Users/sergei/pr/ePorezi/com/itsinbox/smartbox/utils/WinRegistry.java:162: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
    [javac]             byte[] name = (byte[])regEnumValue.invoke(root, new Integer(handles[0]), new Integer(index), new Integer(maxlen + 1));
    [javac]                                                             ^
    [javac] /Users/sergei/pr/ePorezi/com/itsinbox/smartbox/utils/WinRegistry.java:162: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
    [javac]             byte[] name = (byte[])regEnumValue.invoke(root, new Integer(handles[0]), new Integer(index), new Integer(maxlen + 1));
    [javac]                                                                                      ^
    [javac] /Users/sergei/pr/ePorezi/com/itsinbox/smartbox/utils/WinRegistry.java:162: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
    [javac]             byte[] name = (byte[])regEnumValue.invoke(root, new Integer(handles[0]), new Integer(index), new Integer(maxlen + 1));
    [javac]                                                                                                          ^
    [javac] /Users/sergei/pr/ePorezi/com/itsinbox/smartbox/utils/WinRegistry.java:167: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
    [javac]          regCloseKey.invoke(root, new Integer(handles[0]));
    [javac]                                   ^
    [javac] /Users/sergei/pr/ePorezi/com/itsinbox/smartbox/utils/WinRegistry.java:174: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
    [javac]       int[] handles = (int[])regOpenKey.invoke(root, new Integer(hkey), toCstr(key), new Integer(131097));
    [javac]                                                      ^
    [javac] /Users/sergei/pr/ePorezi/com/itsinbox/smartbox/utils/WinRegistry.java:174: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
    [javac]       int[] handles = (int[])regOpenKey.invoke(root, new Integer(hkey), toCstr(key), new Integer(131097));
    [javac]                                                                                      ^
    [javac] /Users/sergei/pr/ePorezi/com/itsinbox/smartbox/utils/WinRegistry.java:178: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
    [javac]          int[] info = (int[])regQueryInfoKey.invoke(root, new Integer(handles[0]));
    [javac]                                                           ^
    [javac] /Users/sergei/pr/ePorezi/com/itsinbox/smartbox/utils/WinRegistry.java:183: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
    [javac]             byte[] name = (byte[])regEnumKeyEx.invoke(root, new Integer(handles[0]), new Integer(index), new Integer(maxlen + 1));
    [javac]                                                             ^
    [javac] /Users/sergei/pr/ePorezi/com/itsinbox/smartbox/utils/WinRegistry.java:183: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
    [javac]             byte[] name = (byte[])regEnumKeyEx.invoke(root, new Integer(handles[0]), new Integer(index), new Integer(maxlen + 1));
    [javac]                                                                                      ^
    [javac] /Users/sergei/pr/ePorezi/com/itsinbox/smartbox/utils/WinRegistry.java:183: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
    [javac]             byte[] name = (byte[])regEnumKeyEx.invoke(root, new Integer(handles[0]), new Integer(index), new Integer(maxlen + 1));
    [javac]                                                                                                          ^
    [javac] /Users/sergei/pr/ePorezi/com/itsinbox/smartbox/utils/WinRegistry.java:187: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
    [javac]          regCloseKey.invoke(root, new Integer(handles[0]));
    [javac]                                   ^
    [javac] /Users/sergei/pr/ePorezi/com/itsinbox/smartbox/utils/WinRegistry.java:193: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
    [javac]       return (int[])regCreateKeyEx.invoke(root, new Integer(hkey), toCstr(key));
    [javac]                                                 ^
    [javac] /Users/sergei/pr/ePorezi/com/itsinbox/smartbox/utils/WinRegistry.java:197: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
    [javac]       int[] handles = (int[])regOpenKey.invoke(root, new Integer(hkey), toCstr(key), new Integer(983103));
    [javac]                                                      ^
    [javac] /Users/sergei/pr/ePorezi/com/itsinbox/smartbox/utils/WinRegistry.java:197: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
    [javac]       int[] handles = (int[])regOpenKey.invoke(root, new Integer(hkey), toCstr(key), new Integer(983103));
    [javac]                                                                                      ^
    [javac] /Users/sergei/pr/ePorezi/com/itsinbox/smartbox/utils/WinRegistry.java:198: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
    [javac]       regSetValueEx.invoke(root, new Integer(handles[0]), toCstr(valueName), toCstr(value));
    [javac]                                  ^
    [javac] /Users/sergei/pr/ePorezi/com/itsinbox/smartbox/utils/WinRegistry.java:199: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
    [javac]       regCloseKey.invoke(root, new Integer(handles[0]));
    [javac]                                ^
    [javac] Note: Some input files use or override a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.
    [javac] Note: Some input files use unchecked or unsafe operations.
    [javac] Note: Recompile with -Xlint:unchecked for details.
    [javac] 1 error
    [javac] 30 warnings

BUILD FAILED
/Users/sergei/pr/ePorezi/build.xml:15: Compile failed; see the compiler error output for details.

Total time: 0 seconds

Do you have any advice? I am a newbie with Java

Kasokaso commented 1 year ago

I managed to run it locally but it doesn't recognise card reader. It would be nice to have some kind of readme file

SergeiPatiakin commented 1 year ago

@Kasokaso I think you should open a separate issue for that. I managed to run the app fine from a Github release ( https://github.com/OpenSerbianEID/ePorezi/releases/tag/1.2.2-5 ). However, I'm having trouble building the app from source.

najdanovicivan commented 1 year ago

You need flag

-Dsun.security.smartcardio.library={pathToDylib} duu to some macOS permissions stuff

Take a look at build.xml for further reference

SergeiPatiakin commented 1 year ago

@najdanovicivan Which JDK (vendor and version) did you use to compile the project?

najdanovicivan commented 1 year ago

I used Java 8 from oracle and I compiled it from JetBrains IDEA CE