You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Carlos Abad (JIRA)" <ji...@apache.org> on 2016/07/11 22:52:11 UTC
[jira] [Commented] (CASSANDRA-9608) Support Java 9
[ https://issues.apache.org/jira/browse/CASSANDRA-9608?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15371835#comment-15371835 ]
Carlos Abad commented on CASSANDRA-9608:
----------------------------------------
Carlos Abad here from the Intel Java team.
I've been able to build Cassandra with JDK9 (build 125) applying the modifications noted below.
However the build only pass 70% of the Unit tests.
*At least Apache Ant version 1.9.7 is required for JDK9. Previous version are unable to load the JavaScript script engine manager in JDK9.
build.xml:
*Generating Bytecode for Java 9. Source is still written for Java 8.
*Java 9 removed -Xbootclasspath/p command option. Without this option Cassandra will depend on the given Java classpath to include the CRC32 class
*To avoid "Annotation generator had thrown the exception. java.lang.NoClassDefFoundError: javax/annotation/Generated" need to add "-addmods java.annotations.common" to the javac task of the "build-test" target.
src/java/org/apache/cassandra/utils/Throwables.java:
*Stream.of() throws an exception now, need to be captured.
src/java/org/apache/cassandra/utils/concurrent/Locks.java:
*sun.misc.unsafe is going away. Fortunately cassandra.utils.concurrent.Locks is only used in one place (db/partitions/AtomicBTreePartition, see below). It'll be enough to modify AtomicBTreePartitions and remove this class.
src/java/org/apache/cassandra/db/partitions/AtomicBTreePartition.java:
*This is the only place where the class cassandra.utils.concurrent.Locks is used. We'll modify it to use Java's ReentrantLock instead.
> Support Java 9
> --------------
>
> Key: CASSANDRA-9608
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9608
> Project: Cassandra
> Issue Type: Task
> Reporter: Robert Stupp
> Priority: Minor
>
> This ticket is intended to group all issues found to support Java 9 in the future.
> From what I've found out so far:
> * Maven dependency {{com.sun:tools:jar:0}} via cobertura cannot be resolved. It can be easily solved using this patch:
> {code}
> - <dependency groupId="net.sourceforge.cobertura" artifactId="cobertura"/>
> + <dependency groupId="net.sourceforge.cobertura" artifactId="cobertura">
> + <exclusion groupId="com.sun" artifactId="tools"/>
> + </dependency>
> {code}
> * Another issue is that {{sun.misc.Unsafe}} no longer contains the methods {{monitorEnter}} + {{monitorExit}}. These methods are used by {{o.a.c.utils.concurrent.Locks}} which is only used by {{o.a.c.db.AtomicBTreeColumns}}.
> I don't mind to start working on this yet since Java 9 is in a too early development phase.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)