Class LibJ2PCSCGNULinuxFix
java.lang.Object
es.gob.jmulticard.jse.smartcardio.LibJ2PCSCGNULinuxFix
Encapsulate fixes regarding the dynamic loading of the pcsclite library on
GNU/Linux Systems. Statically call LibJ2PCSCGNULinuxFix.fixNativeLibrary()
before using a TerminalFactory.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final int
private static final String
private static final String
private static final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static String
addMultiarchPath
(String libPath, String suffix) private static String
extendLibraryPath
(String libPath, String extension) Return the path with extension appended, if it wasn't already contained in the path.private static File
findGNULinuxNativeLibrary
(String baseName, int version) Finds.so.version
file on GNU/Linux.(package private) static void
Make sure libpcsclite is found.private static String
fixPathForUbuntuMultiLib
(String libraryPath) Oracle Java 7,java.library.path
is severely limited as compared to the OpenJDK default and doesn't contain Ubuntu 12's MULTILIB directories.private static LibJ2PCSCGNULinuxFix.UbuntuBitness
Determine Ubuntu-type multilib configuration.
-
Field Details
-
PCSC_LIBRARY_VERSION
private static final int PCSC_LIBRARY_VERSION- See Also:
-
SMARTCARDIO_LIBRARY_PROPERTY
- See Also:
-
LIBRARY_PATH_PROPERTY
- See Also:
-
GNULINUX_OS_PROPERTY_PREFIX
- See Also:
-
PCSC_LIBRARY_NAME
- See Also:
-
UBUNTU_MULTILIB_32_SUFFIX
- See Also:
-
UBUNTU_MULTILIB_64_SUFFIX
- See Also:
-
JRE_BITNESS_PROPERTY
- See Also:
-
OS_NAME_PROPERTY
- See Also:
-
JRE_BITNESS_32_VALUE
- See Also:
-
JRE_BITNESS_64_VALUE
- See Also:
-
LIBDIR
- See Also:
-
-
Constructor Details
-
LibJ2PCSCGNULinuxFix
private LibJ2PCSCGNULinuxFix()
-
-
Method Details
-
fixNativeLibrary
static void fixNativeLibrary()Make sure libpcsclite is found. The libj2pcsc.so from the JRE attempts to dlopen using the linker name "libpcsclite.so" instead of the appropriate "libpcsclite.so.1". This causes libpcsclite not to be found on GNU/Linux distributions that don't have the libpcsclite.so symbolic link. This method finds the library and forces the JRE to use it instead of attempting to locate it by itself. See also: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=529339
Does nothing if not on a GNU/Linux system. -
getUbuntuBitness
Determine Ubuntu-type multilib configuration. -
extendLibraryPath
Return the path with extension appended, if it wasn't already contained in the path. -
addMultiarchPath
-
fixPathForUbuntuMultiLib
Oracle Java 7,java.library.path
is severely limited as compared to the OpenJDK default and doesn't contain Ubuntu 12's MULTILIB directories. Test for Ubuntu in various configs and add the required paths. -
findGNULinuxNativeLibrary
Finds.so.version
file on GNU/Linux. avoid guessing all GNU/Linux distros' library path configurations on 32 and 64-bit when working around the buggy libj2pcsc.so implementation based on JRE implementations adding the native library paths to the end of java.library.path. Fixes the path for Oracle JRE which doesn't contain the Ubuntu MULTILIB directories.
-