teragrep / jpr_01 Goto Github PK
View Code? Open in Web Editor NEWJava PCRE Library
License: Apache License 2.0
Java PCRE Library
License: Apache License 2.0
on jpr_01 3.0.0, JavaPcre pcre = new JavaPcre();
causes
java.lang.UnsatisfiedLinkError: Unable to load library 'JavaPcre':
libJavaPcre.so: cannot open shared object file: No such file or directory
libJavaPcre.so: cannot open shared object file: No such file or directory
Native library (linux-x86-64/libJavaPcre.so) not found in resource path (...)
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:307)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:467)
at com.sun.jna.Library$Handler.<init>(Library.java:192)
at com.sun.jna.Native.load(Native.java:622)
at com.sun.jna.Native.load(Native.java:596)
at com.teragrep.jpr_01.JavaPcre$LibJavaPcre.<clinit>(JavaPcre.java:39)
at sun.misc.Unsafe.ensureClassInitialized(Native Method)
at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:43)
at sun.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:156)
at java.lang.reflect.Field.acquireFieldAccessor(Field.java:1088)
at java.lang.reflect.Field.getFieldAccessor(Field.java:1069)
at java.lang.reflect.Field.get(Field.java:393)
at com.sun.jna.Native.loadLibraryInstance(Native.java:694)
at com.sun.jna.Native.getLibraryOptions(Native.java:764)
at com.sun.jna.Native.getStructureAlignment(Native.java:856)
at com.sun.jna.Structure.setAlignType(Structure.java:291)
at com.sun.jna.Structure.<init>(Structure.java:208)
at com.sun.jna.Structure.<init>(Structure.java:204)
at com.sun.jna.Structure.<init>(Structure.java:191)
at com.sun.jna.Structure.<init>(Structure.java:183)
at com.teragrep.jpr_01.JavaPcre$LibJavaPcre$OptionsStruct.<init>(JavaPcre.java:42)
at com.teragrep.jpr_01.JavaPcre.<init>(JavaPcre.java:176)
current implementation is very focused on replicating the original library structure.
could you please provide a package for arm?
currently org.teragrep is used, however we release under com.teragrep groupId so the package should be changed to com.teragrep.jpr_01
Related issue
How do I use it in Windows?
https://www.pcre.org/current/doc/html/pcre2api.html tells that PCRE2_INFO_NAMETABLE should be available via pcre2_pattern_info
change the Java classes to use AutoCloseable interface so that pointers get automatically freed
see https://www.yegor256.com/2017/08/08/raii-in-java.html
then usage of the resources should happen with try-with-resources which ensures their closing
try (final SomeClass sc = new SomeClass("perhaps arg").open()) { // allocates memory, open returns allocated instance of the class
System.out.println("you have call()ed and it provides you with " + sc.something());
} // frees it because close is automatically done
care must be taken that SomeClass methods are blocked while allocation is not done, for example with AtomicBoolean and if not the thr IllegalStateException
see also https://stackoverflow.com/a/69444249
results of regex cannot be accessed, the Maps are not exposed to the outside (package-private).
should be public or have public getters
https://github.com/teragrep/jpr_01/blob/main/src/main/java/org/teragrep/JavaPcre.java#L175
should have "public" keyword to make it accessible from different packages
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.