Skip to content

Commit

Permalink
change to jdk 1.8
Browse files Browse the repository at this point in the history
Signed-off-by: Ranger Tsao <[email protected]>
  • Loading branch information
boliza committed Jun 21, 2018
1 parent 387a554 commit 522dd72
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 20 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ Thanks the great projects:

> Package `com.hankcs.lucene` copy from [hanlp-lucene-plugin](https://github.com/hankcs/hanlp-lucene-plugin)

# Issue

Can't use custom dictionary in JDK9. So change `targetCompatibility` to 1.8.

All published releases had build on JDK9.

# Build and Install

## Install lib
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'elasticsearch.esplugin'

sourceCompatibility = JavaVersion.VERSION_1_9
targetCompatibility = JavaVersion.VERSION_1_9
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

licenseFile = rootProject.file('LICENSE.txt')
noticeFile = rootProject.file('NOTICE.txt')
Expand Down
34 changes: 16 additions & 18 deletions src/main/plugin-metadata/plugin-security.policy
Original file line number Diff line number Diff line change
@@ -1,31 +1,29 @@
grant {
// HanLP data directories
permission java.io.FilePermission "<<ALL FILES>>", "read,write";

// needed because of problems in unbound LDAP library
permission java.util.PropertyPermission "*", "read,write";

// needed to set expert SSL options, etc
permission java.lang.RuntimePermission "setFactory";
permission javax.net.ssl.SSLPermission "setHostnameVerifier";

// needed when sending emails for javax.activation
// otherwise a classnotfound exception is thrown due to trying
// to load the class with the application class loader
permission java.lang.RuntimePermission "setContextClassLoader";
permission java.lang.RuntimePermission "getClassLoader";
// TODO: remove use of this jar as soon as possible!!!!
permission java.lang.RuntimePermission "accessClassInPackage.com.sun.activation.registries";

// bouncy castle
permission java.lang.RuntimePermission "accessClassInPackage.sun.misc";
permission java.lang.RuntimePermission "accessClassInPackage.sun.reflect";
permission java.lang.RuntimePermission "reflectionFactoryAccess";
permission java.lang.RuntimePermission "accessDeclaredMembers";
permission java.lang.RuntimePermission "accessClassInPackage.sun.jdbc.odbc";
permission java.security.SecurityPermission "putProviderProperty.BC";

// needed for x-pack security extension
permission java.security.SecurityPermission "createPolicy.JavaPolicy";
permission java.security.SecurityPermission "getPolicy";
permission java.security.SecurityPermission "setPolicy";

// Netty SelectorUtil wants to change this, because of https://bugs.openjdk.java.net/browse/JDK-6427854
// the bug says it only happened rarely, and that its fixed, but apparently it still happens rarely!
permission java.util.PropertyPermission "sun.nio.ch.bugLevel", "write";
permission java.util.PropertyPermission "*","read,write";
permission java.util.PropertyPermission "file.encoding", "read";
permission java.util.PropertyPermission "user.dir ", "read ";
permission java.util.PropertyPermission "user.home ", "read ";
permission java.util.PropertyPermission "java.home ", "read ";
permission java.util.PropertyPermission "java.class.path ", "read ";
permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
permission javax.net.ssl.SSLPermission "setHostnameVerifier";
permission org.elasticsearch.script.ClassPermission "com.hankcs.*";
permission org.elasticsearch.script.ClassPermission "org.elasticsearch.*";
/// permission java.lang.RuntimePermission "accessClassInPackage.jdk.internal.ref";
};

0 comments on commit 522dd72

Please sign in to comment.