From 5e17f315d47f29158804f4eda96e47b10c0d9302 Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Thu, 20 Nov 2014 22:47:21 +0000 Subject: [PATCH] LUCENE-5950: Move to Java 8 as minimum Java version git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1640833 13f79535-47bb-0310-9956-ffa450edef68 --- build.xml | 22 +--- .../dot.settings/org.eclipse.jdt.core.prefs | 6 +- dev-tools/maven/README.maven | 6 +- dev-tools/maven/pom.xml.template | 2 +- dev-tools/scripts/smokeTestRelease.py | 105 ++++++------------ lucene/BUILD.txt | 8 +- lucene/CHANGES.txt | 5 + lucene/SYSTEM_REQUIREMENTS.txt | 5 +- lucene/build.xml | 2 +- lucene/common-build.xml | 58 ++++------ .../apache/lucene/search/LiveFieldValues.java | 2 +- .../spans/SpanMultiTermQueryWrapper.java | 5 +- .../org/apache/lucene/util/Constants.java | 2 +- .../lucene/index/TestPrefixCodedTerms.java | 4 +- lucene/expressions/build.xml | 4 - .../lucene/search/grouping/TestGrouping.java | 4 +- lucene/tools/javadoc/ecj.javadocs.prefs | 8 +- .../javadoc/{java7 => java8}/package-list | 8 ++ solr/CHANGES.txt | 5 + solr/README.txt | 4 +- solr/SYSTEM_REQUIREMENTS.txt | 5 +- solr/bin/solr.cmd | 4 +- solr/build.xml | 2 +- solr/common-build.xml | 6 +- .../solr/collection1/conf/schema.xml | 2 +- .../conf/dataimport-solr_id-schema.xml | 2 +- .../uima/solr/collection1/conf/schema.xml | 2 +- .../uima/uima-tokenizers-schema.xml | 2 +- .../MaxFieldValueUpdateProcessorFactory.java | 5 +- .../MinFieldValueUpdateProcessorFactory.java | 5 +- .../solr/collection1/conf/schema-trie.xml | 2 +- .../solr/collection1/conf/schema11.xml | 2 +- .../example-DIH/solr/db/conf/schema.xml | 2 +- .../example-DIH/solr/mail/conf/schema.xml | 2 +- .../example-DIH/solr/rss/conf/schema.xml | 2 +- .../example-DIH/solr/solr/conf/schema.xml | 2 +- .../conf/schema.xml | 2 +- solr/site/html/tutorial.html | 4 +- 38 files changed, 136 insertions(+), 182 deletions(-) rename lucene/tools/javadoc/{java7 => java8}/package-list (96%) diff --git a/build.xml b/build.xml index e0808c625cc..57f848ea33d 100644 --- a/build.xml +++ b/build.xml @@ -279,7 +279,7 @@ SUCCESS: You must right-click your project and choose Refresh. - Your project must use a Java 7 JRE. + Your project must use a Java 8 JRE. @@ -326,7 +326,7 @@ following two XML attributes/values (adjust values according to JDKs you have defined locally - see File | Project Structure | Platform Settings | SDKs): - idea.jdk = project-jdk-name="1.7" project-jdk-type="JavaSDK" + idea.jdk = project-jdk-name="1.8" project-jdk-type="JavaSDK" @@ -373,22 +373,13 @@ File | Project Structure | Platform Settings | SDKs): - - - - - - - - - - + + - + - @@ -412,7 +403,6 @@ File | Project Structure | Platform Settings | SDKs): - diff --git a/dev-tools/eclipse/dot.settings/org.eclipse.jdt.core.prefs b/dev-tools/eclipse/dot.settings/org.eclipse.jdt.core.prefs index c8527279444..5ad4c2a00e7 100644 --- a/dev-tools/eclipse/dot.settings/org.eclipse.jdt.core.prefs +++ b/dev-tools/eclipse/dot.settings/org.eclipse.jdt.core.prefs @@ -1,7 +1,7 @@ #Sun Sep 23 13:02:27 EDT 2012 eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 -org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.doc.comment.support=enabled org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error @@ -18,7 +18,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public -org.eclipse.jdt.core.compiler.source=1.7 +org.eclipse.jdt.core.compiler.source=1.8 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 diff --git a/dev-tools/maven/README.maven b/dev-tools/maven/README.maven index 8bd031c9ab1..a942ec99369 100644 --- a/dev-tools/maven/README.maven +++ b/dev-tools/maven/README.maven @@ -36,7 +36,7 @@ A. How to use nightly Jenkins-built Lucene/Solr Maven artifacts B. How to generate Lucene/Solr Maven artifacts - Prerequisites: JDK 1.7+ and Ant 1.8.2+ + Prerequisites: JDK 1.8+ and Ant 1.8.2+ Run 'ant generate-maven-artifacts' to create an internal Maven repository, including POMs, binary .jars, source .jars, and javadoc @@ -50,7 +50,7 @@ B. How to generate Lucene/Solr Maven artifacts C. How to deploy Maven artifacts to a repository - Prerequisites: JDK 1.7+ and Ant 1.8.2+ + Prerequisites: JDK 1.8+ and Ant 1.8.2+ You can deploy targets for all of Lucene/Solr, only Lucene, or only Solr, as in B. above. To deploy to a Maven repository, the command is the same @@ -77,7 +77,7 @@ D. How to use Maven to build Lucene/Solr The details, followed by some example Maven commands: - 1. Prerequisites: JDK 1.7+ and Maven 2.2.1 or 3.X + 1. Prerequisites: JDK 1.8+ and Maven 2.2.1 or 3.X 2. Make sure your sources are up to date. If you checked your sources out from the Apache Subversion repository, run "svn update" from the top diff --git a/dev-tools/maven/pom.xml.template b/dev-tools/maven/pom.xml.template index 7bc80429b3f..f5dd902c6e3 100644 --- a/dev-tools/maven/pom.xml.template +++ b/dev-tools/maven/pom.xml.template @@ -43,7 +43,7 @@ http://svn.apache.org/viewvc/lucene/dev/trunk @spec.version@ yyyy-MM-dd HH:mm:ss - 1.7 + 1.8 8.1.10.v20130312 diff --git a/dev-tools/scripts/smokeTestRelease.py b/dev-tools/scripts/smokeTestRelease.py index c88257ea4f4..2e1c18fa636 100644 --- a/dev-tools/scripts/smokeTestRelease.py +++ b/dev-tools/scripts/smokeTestRelease.py @@ -171,15 +171,15 @@ def checkJARMetaData(desc, jarFile, svnRevision, version): for verify in ( 'Specification-Vendor: The Apache Software Foundation', 'Implementation-Vendor: The Apache Software Foundation', - # Make sure 1.7 compiler was used to build release bits: - 'X-Compile-Source-JDK: 1.7', + # Make sure 1.8 compiler was used to build release bits: + 'X-Compile-Source-JDK: 1.8', # Make sure 1.8 ant was used to build release bits: (this will match 1.8+) 'Ant-Version: Apache Ant 1.8', - # Make sure .class files are 1.7 format: - 'X-Compile-Target-JDK: 1.7', + # Make sure .class files are 1.8 format: + 'X-Compile-Target-JDK: 1.8', 'Specification-Version: %s' % version, - # Make sure the release was compiled with 1.7: - 'Created-By: 1.7'): + # Make sure the release was compiled with 1.8: + 'Created-By: 1.8'): if s.find(verify) == -1: raise RuntimeError('%s is missing "%s" inside its META-INF/MANIFEST.MF' % \ (desc, verify)) @@ -705,54 +705,32 @@ def verifyUnpacked(java, project, artifact, unpackPath, svnRevision, version, te raise RuntimeError('source release has WARs...') print(' run "ant validate"') - java.run_java7('ant validate', '%s/validate.log' % unpackPath) + java.run_java8('ant validate', '%s/validate.log' % unpackPath) if project == 'lucene': - print(" run tests w/ Java 7 and testArgs='%s'..." % testArgs) - java.run_java7('ant clean test %s' % testArgs, '%s/test.log' % unpackPath) - java.run_java7('ant jar', '%s/compile.log' % unpackPath) - testDemo(java.run_java7, isSrc, version, '1.7') + print(" run tests w/ Java 8 and testArgs='%s'..." % testArgs) + java.run_java8('ant clean test %s' % testArgs, '%s/test.log' % unpackPath) + java.run_java8('ant jar', '%s/compile.log' % unpackPath) + testDemo(java.run_java8, isSrc, version, '1.8') - print(' generate javadocs w/ Java 7...') - java.run_java7('ant javadocs', '%s/javadocs.log' % unpackPath) + print(' generate javadocs w/ Java 8...') + java.run_java8('ant javadocs', '%s/javadocs.log' % unpackPath) checkJavadocpathFull('%s/build/docs' % unpackPath) - if java.run_java8: - print(" run tests w/ Java 8 and testArgs='%s'..." % testArgs) - java.run_java8('ant clean test %s' % testArgs, '%s/test.log' % unpackPath) - java.run_java8('ant jar', '%s/compile.log' % unpackPath) - testDemo(java.run_java8, isSrc, version, '1.8') - - print(' generate javadocs w/ Java 8...') - java.run_java8('ant javadocs', '%s/javadocs.log' % unpackPath) - checkJavadocpathFull('%s/build/docs' % unpackPath) - else: os.chdir('solr') - print(" run tests w/ Java 7 and testArgs='%s'..." % testArgs) - java.run_java7('ant clean test -Dtests.slow=false %s' % testArgs, '%s/test.log' % unpackPath) + print(" run tests w/ Java 8 and testArgs='%s'..." % testArgs) + java.run_java8('ant clean test -Dtests.slow=false %s' % testArgs, '%s/test.log' % unpackPath) # test javadocs - print(' generate javadocs w/ Java 7...') - java.run_java7('ant clean javadocs', '%s/javadocs.log' % unpackPath) + print(' generate javadocs w/ Java 8...') + java.run_java8('ant clean javadocs', '%s/javadocs.log' % unpackPath) checkJavadocpathFull('%s/solr/build/docs' % unpackPath, False) - print(' test solr example w/ Java 7...') - java.run_java7('ant clean example', '%s/antexample.log' % unpackPath) - testSolrExample(unpackPath, java.java7_home, True) - - if java.run_java8: - print(" run tests w/ Java 8 and testArgs='%s'..." % testArgs) - java.run_java8('ant clean test -Dtests.slow=false %s' % testArgs, '%s/test.log' % unpackPath) - - print(' generate javadocs w/ Java 8...') - java.run_java8('ant clean javadocs', '%s/javadocs.log' % unpackPath) - checkJavadocpathFull('%s/solr/build/docs' % unpackPath, False) - - print(' test solr example w/ Java 8...') - java.run_java8('ant clean example', '%s/antexample.log' % unpackPath) - testSolrExample(unpackPath, java.java8_home, True) + print(' test solr example w/ Java 8...') + java.run_java8('ant clean example', '%s/antexample.log' % unpackPath) + testSolrExample(unpackPath, java.java8_home, True) os.chdir('..') print(' check NOTICE') @@ -763,9 +741,7 @@ def verifyUnpacked(java, project, artifact, unpackPath, svnRevision, version, te checkAllJARs(os.getcwd(), project, svnRevision, version, tmpDir, baseURL) if project == 'lucene': - testDemo(java.run_java7, isSrc, version, '1.7') - if java.run_java8: - testDemo(java.run_java8, isSrc, version, '1.8') + testDemo(java.run_java8, isSrc, version, '1.8') print(' check Lucene\'s javadoc JAR') checkJavadocpath('%s/docs' % unpackPath) @@ -773,24 +749,14 @@ def verifyUnpacked(java, project, artifact, unpackPath, svnRevision, version, te else: checkSolrWAR('%s/server/webapps/solr.war' % unpackPath, svnRevision, version, tmpDir, baseURL) - print(' copying unpacked distribution for Java 7 ...') - java7UnpackPath = '%s-java7' % unpackPath - if os.path.exists(java7UnpackPath): - shutil.rmtree(java7UnpackPath) - shutil.copytree(unpackPath, java7UnpackPath) - os.chdir(java7UnpackPath) - print(' test solr example w/ Java 7...') - testSolrExample(java7UnpackPath, java.java7_home, False) - - if java.run_java8: - print(' copying unpacked distribution for Java 8 ...') - java8UnpackPath = '%s-java8' % unpackPath - if os.path.exists(java8UnpackPath): - shutil.rmtree(java8UnpackPath) - shutil.copytree(unpackPath, java8UnpackPath) - os.chdir(java8UnpackPath) - print(' test solr example w/ Java 8...') - testSolrExample(java8UnpackPath, java.java8_home, False) + print(' copying unpacked distribution for Java 8 ...') + java8UnpackPath = '%s-java8' % unpackPath + if os.path.exists(java8UnpackPath): + shutil.rmtree(java8UnpackPath) + shutil.copytree(unpackPath, java8UnpackPath) + os.chdir(java8UnpackPath) + print(' test solr example w/ Java 8...') + testSolrExample(java8UnpackPath, java.java8_home, False) os.chdir(unpackPath) @@ -1302,16 +1268,13 @@ def make_java_config(parser, java8_home): def run_java(cmd, logfile): run('%s; %s' % (cmd_prefix, cmd), logfile) return run_java - java7_home = os.environ.get('JAVA_HOME') - if java7_home is None: + java8_home = os.environ.get('JAVA_HOME') + if java8_home is None: parser.error('JAVA_HOME must be set') - run_java7 = _make_runner(java7_home, '1.7') - run_java8 = None - if java8_home is not None: - run_java8 = _make_runner(java8_home, '1.8') + run_java8 = _make_runner(java8_home, '1.8') - jc = namedtuple('JavaConfig', 'run_java7 java7_home run_java8 java8_home') - return jc(run_java7, java7_home, run_java8, java8_home) + jc = namedtuple('JavaConfig', 'run_java8 java8_home') + return jc(run_java8, java8_home) version_re = re.compile(r'(\d+\.\d+\.\d+(-ALPHA|-BETA)?)') revision_re = re.compile(r'rev(\d+)') diff --git a/lucene/BUILD.txt b/lucene/BUILD.txt index 5658305de0c..9c66e813662 100644 --- a/lucene/BUILD.txt +++ b/lucene/BUILD.txt @@ -1,19 +1,19 @@ Lucene Build Instructions Basic steps: - 0) Install JDK 1.7 (or greater), Ant 1.8.2+, Ivy 2.2.0 + 0) Install JDK 1.8 (or greater), Ant 1.8.2+, Ivy 2.2.0 1) Download Lucene from Apache and unpack it 2) Connect to the top-level of your Lucene installation 3) Install JavaCC (optional) 4) Run ant -Step 0) Set up your development environment (JDK 1.7 or greater, +Step 0) Set up your development environment (JDK 1.8 or greater, Ant 1.8.2+, Ivy 2.2.0) We'll assume that you know how to get and set up the JDK - if you -don't, then we suggest starting at http://java.sun.com and learning +don't, then we suggest starting at http://www.oracle.com/java/ and learning more about Java, before returning to this README. Lucene runs with -JDK 1.7 and later. +JDK 1.8 and later. Like many Open Source java projects, Lucene uses Apache Ant for build control. Specifically, you MUST use Ant version 1.8.2+. diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt index 1d9d55ab80c..46a1d58e81b 100644 --- a/lucene/CHANGES.txt +++ b/lucene/CHANGES.txt @@ -5,6 +5,11 @@ http://s.apache.org/luceneversions ======================= Lucene 6.0.0 ======================= +System Requirements + +* LUCENE-5950: Move to Java 8 as minimum Java version. + (Ryan Ernst) + New Features API Changes diff --git a/lucene/SYSTEM_REQUIREMENTS.txt b/lucene/SYSTEM_REQUIREMENTS.txt index 623120de281..a8887198555 100644 --- a/lucene/SYSTEM_REQUIREMENTS.txt +++ b/lucene/SYSTEM_REQUIREMENTS.txt @@ -1,9 +1,6 @@ # System Requirements -Apache Lucene runs of Java 7 or greater, Java 8 is verified to be -compatible and may bring some performance improvements. When using -Oracle Java 7 or OpenJDK 7, be sure to not use the GA build 147 or -update versions u40, u45 and u51! We recommend using u55 or later. +Apache Lucene runs on Java 8 or greater. It is also recommended to always use the latest update version of your Java VM, because bugs may affect Lucene. An overview of known JVM bugs diff --git a/lucene/build.xml b/lucene/build.xml index 0b98bb6cdac..a1c4c867a32 100644 --- a/lucene/build.xml +++ b/lucene/build.xml @@ -336,7 +336,7 @@ - + diff --git a/lucene/common-build.xml b/lucene/common-build.xml index 772fa65cc78..0ac0d7e6842 100644 --- a/lucene/common-build.xml +++ b/lucene/common-build.xml @@ -162,13 +162,13 @@ - - + + - + - + @@ -287,7 +287,7 @@ @@ -304,9 +304,9 @@ - + - + @@ -332,7 +332,6 @@ --> - @@ -350,10 +349,7 @@ - - - - + @@ -361,15 +357,10 @@ - - - - - - - - - + + + + @@ -381,12 +372,8 @@ - - - - - - + + @@ -919,7 +906,7 @@ - - - - + @@ -1974,7 +1958,7 @@ ${ant.project.name}.test.dependencies=${test.classpath.list} - + @@ -2004,7 +1988,7 @@ ${ant.project.name}.test.dependencies=${test.classpath.list} - + Copyright © ${year} Apache Software Foundation. All Rights Reserved. @@ -2144,10 +2128,10 @@ ${ant.project.name}.test.dependencies=${test.classpath.list} - - + + + dest="${javadoc.packagelist.dir}/java8/package-list" ignoreerrors="true"/> diff --git a/lucene/core/src/java/org/apache/lucene/search/LiveFieldValues.java b/lucene/core/src/java/org/apache/lucene/search/LiveFieldValues.java index bed65336649..99c3292e5e6 100644 --- a/lucene/core/src/java/org/apache/lucene/search/LiveFieldValues.java +++ b/lucene/core/src/java/org/apache/lucene/search/LiveFieldValues.java @@ -101,7 +101,7 @@ public abstract class LiveFieldValues implements ReferenceManager.RefreshLi if (value == missingValue) { // Deleted but the deletion is not yet reflected in // the reader: - return null; + return (T)null; } else if (value != null) { return value; } else { diff --git a/lucene/core/src/java/org/apache/lucene/search/spans/SpanMultiTermQueryWrapper.java b/lucene/core/src/java/org/apache/lucene/search/spans/SpanMultiTermQueryWrapper.java index b300b513635..36326bb424d 100644 --- a/lucene/core/src/java/org/apache/lucene/search/spans/SpanMultiTermQueryWrapper.java +++ b/lucene/core/src/java/org/apache/lucene/search/spans/SpanMultiTermQueryWrapper.java @@ -110,7 +110,10 @@ public class SpanMultiTermQueryWrapper extends SpanQue public String toString(String field) { StringBuilder builder = new StringBuilder(); builder.append("SpanMultiTermQueryWrapper("); - builder.append(query.toString(field)); + // NOTE: query.toString must be placed in a temp local to avoid compile errors on Java 8u20 + // see https://bugs.openjdk.java.net/browse/JDK-8056984?page=com.atlassian.streams.streams-jira-plugin:activity-stream-issue-tab + String queryStr = query.toString(field); + builder.append(queryStr); builder.append(")"); if (getBoost() != 1F) { builder.append('^'); diff --git a/lucene/core/src/java/org/apache/lucene/util/Constants.java b/lucene/core/src/java/org/apache/lucene/util/Constants.java index 4d767081570..d4fe9ead95f 100644 --- a/lucene/core/src/java/org/apache/lucene/util/Constants.java +++ b/lucene/core/src/java/org/apache/lucene/util/Constants.java @@ -92,7 +92,7 @@ public final class Constants { } JRE_IS_64BIT = is64Bit; } - + public static final boolean JRE_IS_MINIMUM_JAVA8 = JVM_MAJOR_VERSION > 1 || (JVM_MAJOR_VERSION == 1 && JVM_MINOR_VERSION >= 8); public static final boolean JRE_IS_MINIMUM_JAVA9 = JVM_MAJOR_VERSION > 1 || (JVM_MAJOR_VERSION == 1 && JVM_MINOR_VERSION >= 9); diff --git a/lucene/core/src/test/org/apache/lucene/index/TestPrefixCodedTerms.java b/lucene/core/src/test/org/apache/lucene/index/TestPrefixCodedTerms.java index 4676904ef6e..d5be334d9e7 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestPrefixCodedTerms.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestPrefixCodedTerms.java @@ -113,7 +113,9 @@ public class TestPrefixCodedTerms extends LuceneTestCase { } Iterator expected = superSet.iterator(); - Iterator actual = new MergedIterator<>(subs.toArray(new Iterator[0])); + // NOTE: currenlty using diamond operator on MergedIterator (without explicit Term class) causes + // errors on ecj used for javadoc lint + Iterator actual = new MergedIterator(subs.toArray(new Iterator[0])); while (actual.hasNext()) { assertTrue(expected.hasNext()); assertEquals(expected.next(), actual.next()); diff --git a/lucene/expressions/build.xml b/lucene/expressions/build.xml index 123e92c4723..4efbb867216 100644 --- a/lucene/expressions/build.xml +++ b/lucene/expressions/build.xml @@ -98,10 +98,6 @@ - - diff --git a/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestGrouping.java b/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestGrouping.java index 3f2f6da307a..bbab2b6a549 100644 --- a/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestGrouping.java +++ b/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestGrouping.java @@ -315,7 +315,9 @@ public class TestGrouping extends LuceneTestCase { BytesRef groupValue = mvalGd.groupValue.exists() ? ((MutableValueStr) mvalGd.groupValue).value.get() : null; groups.add(new GroupDocs<>(Float.NaN, mvalGd.maxScore, mvalGd.totalHits, mvalGd.scoreDocs, groupValue, mvalGd.groupSortValues)); } - return new TopGroups<>(mvalTopGroups.groupSort, mvalTopGroups.withinGroupSort, mvalTopGroups.totalHitCount, mvalTopGroups.totalGroupedHitCount, groups.toArray(new GroupDocs[groups.size()]), Float.NaN); + // NOTE: currenlty using diamond operator on TopGroups (without explicit Term class) causes + // errors on ecj used for javadoc lint + return new TopGroups(mvalTopGroups.groupSort, mvalTopGroups.withinGroupSort, mvalTopGroups.totalHitCount, mvalTopGroups.totalGroupedHitCount, groups.toArray(new GroupDocs[groups.size()]), Float.NaN); } fail(); return null; diff --git a/lucene/tools/javadoc/ecj.javadocs.prefs b/lucene/tools/javadoc/ecj.javadocs.prefs index 8a01bdd379d..63f22e6c1ec 100644 --- a/lucene/tools/javadoc/ecj.javadocs.prefs +++ b/lucene/tools/javadoc/ecj.javadocs.prefs @@ -4,9 +4,9 @@ org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonN org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault org.eclipse.jdt.core.compiler.annotation.nonnullisdefault=disabled org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable -org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 -org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.doc.comment.support=enabled org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=ignore org.eclipse.jdt.core.compiler.problem.assertIdentifier=error @@ -93,4 +93,4 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disa org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=ignore org.eclipse.jdt.core.compiler.problem.unusedWarningToken=ignore org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=ignore -org.eclipse.jdt.core.compiler.source=1.7 +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/lucene/tools/javadoc/java7/package-list b/lucene/tools/javadoc/java8/package-list similarity index 96% rename from lucene/tools/javadoc/java7/package-list rename to lucene/tools/javadoc/java8/package-list index b52fe94b6a1..351c1868559 100644 --- a/lucene/tools/javadoc/java7/package-list +++ b/lucene/tools/javadoc/java8/package-list @@ -44,15 +44,22 @@ java.security.spec java.sql java.text java.text.spi +java.time +java.time.chrono +java.time.format +java.time.temporal +java.time.zone java.util java.util.concurrent java.util.concurrent.atomic java.util.concurrent.locks +java.util.function java.util.jar java.util.logging java.util.prefs java.util.regex java.util.spi +java.util.stream java.util.zip javax.accessibility javax.activation @@ -204,6 +211,7 @@ org.w3c.dom org.w3c.dom.bootstrap org.w3c.dom.events org.w3c.dom.ls +org.w3c.dom.views org.xml.sax org.xml.sax.ext org.xml.sax.helpers diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index 75be57814c7..53c9d648454 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -29,6 +29,11 @@ Velocity 1.7 and Velocity Tools 2.0 Apache UIMA 2.3.1 Apache ZooKeeper 3.4.6 +System Requirements +---------------------- +* LUCENE-5950: Move to Java 8 as minimum Java version. + (Ryan Ernst) + Upgrading from Solr 5.x ---------------------- diff --git a/solr/README.txt b/solr/README.txt index 4d5e296dfd4..680e08f524c 100644 --- a/solr/README.txt +++ b/solr/README.txt @@ -111,10 +111,10 @@ docs/index.html Instructions for Building Apache Solr from Source ------------------------------------------------- -1. Download the Java SE 7 JDK (Java Development Kit) or later from http://java.sun.com/ +1. Download the Java SE 8 JDK (Java Development Kit) or later from http://www.oracle.com/java/ You will need the JDK installed, and the $JAVA_HOME/bin (Windows: %JAVA_HOME%\bin) folder included on your command path. To test this, issue a "java -version" command - from your shell (command prompt) and verify that the Java version is 1.7 or later. + from your shell (command prompt) and verify that the Java version is 1.8 or later. 2. Download the Apache Ant binary distribution (1.8.2+) from http://ant.apache.org/ You will need Ant installed and the $ANT_HOME/bin (Windows: diff --git a/solr/SYSTEM_REQUIREMENTS.txt b/solr/SYSTEM_REQUIREMENTS.txt index a14c8f5d838..2c0fa87981e 100644 --- a/solr/SYSTEM_REQUIREMENTS.txt +++ b/solr/SYSTEM_REQUIREMENTS.txt @@ -1,9 +1,6 @@ # System Requirements -Apache Solr runs of Java 7 or greater, Java 8 is verified to be -compatible and may bring some performance improvements. When using -Oracle Java 7 or OpenJDK 7, be sure to not use the GA build 147 or -update versions u40, u45 and u51! We recommend using u55 or later. +Apache Solr runs of Java 8 or greater. It is also recommended to always use the latest update version of your Java VM, because bugs may affect Solr. An overview of known JVM bugs diff --git a/solr/bin/solr.cmd b/solr/bin/solr.cmd index 3063583e39a..a7035b32202 100644 --- a/solr/bin/solr.cmd +++ b/solr/bin/solr.cmd @@ -1052,11 +1052,11 @@ IF "%FIRST_ARG%"=="start" ( ) :need_java_home -@echo Please set the JAVA_HOME environment variable to the path where you installed Java 1.7+ +@echo Please set the JAVA_HOME environment variable to the path where you installed Java 1.8+ goto done :need_java_vers -@echo Java 1.7 or later is required to run Solr. +@echo Java 1.8 or later is required to run Solr. goto done :err diff --git a/solr/build.xml b/solr/build.xml index 022f9ec05d1..1404f5baa43 100644 --- a/solr/build.xml +++ b/solr/build.xml @@ -380,7 +380,7 @@ - + diff --git a/solr/common-build.xml b/solr/common-build.xml index f964aa5ae85..223e360b5bb 100644 --- a/solr/common-build.xml +++ b/solr/common-build.xml @@ -25,9 +25,9 @@ - - - + + + diff --git a/solr/contrib/clustering/src/test-files/clustering/solr/collection1/conf/schema.xml b/solr/contrib/clustering/src/test-files/clustering/solr/collection1/conf/schema.xml index 981577c5446..3ca6b12c27c 100644 --- a/solr/contrib/clustering/src/test-files/clustering/solr/collection1/conf/schema.xml +++ b/solr/contrib/clustering/src/test-files/clustering/solr/collection1/conf/schema.xml @@ -244,7 +244,7 @@ See the Java Regular Expression documentation for more infomation on pattern and replacement string syntax. - http://docs.oracle.com/javase/7/docs/api/java/util/regex/package-summary.html + http://docs.oracle.com/javase/8/docs/api/java/util/regex/package-summary.html --> diff --git a/solr/contrib/uima/src/test-files/uima/uima-tokenizers-schema.xml b/solr/contrib/uima/src/test-files/uima/uima-tokenizers-schema.xml index f63705bc399..62d1f91c7eb 100644 --- a/solr/contrib/uima/src/test-files/uima/uima-tokenizers-schema.xml +++ b/solr/contrib/uima/src/test-files/uima/uima-tokenizers-schema.xml @@ -357,7 +357,7 @@ documentation for more information on pattern and replacement string syntax. - http://docs.oracle.com/javase/7/docs/api/java/util/regex/package-summary.html + http://docs.oracle.com/javase/8/docs/api/java/util/regex/package-summary.html --> diff --git a/solr/core/src/java/org/apache/solr/update/processor/MaxFieldValueUpdateProcessorFactory.java b/solr/core/src/java/org/apache/solr/update/processor/MaxFieldValueUpdateProcessorFactory.java index 1ce15fa8ae5..636697322b8 100644 --- a/solr/core/src/java/org/apache/solr/update/processor/MaxFieldValueUpdateProcessorFactory.java +++ b/solr/core/src/java/org/apache/solr/update/processor/MaxFieldValueUpdateProcessorFactory.java @@ -59,8 +59,9 @@ public final class MaxFieldValueUpdateProcessorFactory extends FieldValueSubsetU public Collection pickSubset(Collection values) { Collection result = values; try { - result = Collections.singletonList - (Collections.max(values)); + // NOTE: max must be put into a temp local in order to avoid ecj errors for javadoc lint + Object max = Collections.max(values); + result = Collections.singletonList(max); } catch (ClassCastException e) { throw new SolrException (BAD_REQUEST, diff --git a/solr/core/src/java/org/apache/solr/update/processor/MinFieldValueUpdateProcessorFactory.java b/solr/core/src/java/org/apache/solr/update/processor/MinFieldValueUpdateProcessorFactory.java index fe4e23b12de..da18d73f3e4 100644 --- a/solr/core/src/java/org/apache/solr/update/processor/MinFieldValueUpdateProcessorFactory.java +++ b/solr/core/src/java/org/apache/solr/update/processor/MinFieldValueUpdateProcessorFactory.java @@ -59,8 +59,9 @@ public final class MinFieldValueUpdateProcessorFactory extends FieldValueSubsetU public Collection pickSubset(Collection values) { Collection result = values; try { - result = Collections.singletonList - (Collections.min(values)); + // NOTE: min must be put into a temp local in order to avoid ecj errors for javadoc lint + Object min = Collections.min(values); + result = Collections.singletonList(min); } catch (ClassCastException e) { throw new SolrException (BAD_REQUEST, diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-trie.xml b/solr/core/src/test-files/solr/collection1/conf/schema-trie.xml index 0f879b038e7..bb2b3541e74 100644 --- a/solr/core/src/test-files/solr/collection1/conf/schema-trie.xml +++ b/solr/core/src/test-files/solr/collection1/conf/schema-trie.xml @@ -219,7 +219,7 @@ See the Java Regular Expression documentation for more infomation on pattern and replacement string syntax. - http://docs.oracle.com/javase/7/docs/api/java/util/regex/package-summary.html + http://docs.oracle.com/javase/8/docs/api/java/util/regex/package-summary.html -->
    -
  1. Java 1.7 or greater. Some places you can get it are from +
  2. Java 1.8 or greater. Some places you can get it are from Oracle, Open JDK, or IBM.
    • Running java -version at the command - line should indicate a version number starting with 1.7. + line should indicate a version number starting with 1.8.
    • Gnu's GCJ is not supported and does not work with Solr.