JDK8?

70 views
Skip to first unread message

Hunter Blanks

unread,
Jul 8, 2015, 8:59:51 PM7/8/15
to pl...@googlegroups.com
Hi,

Is there anything I should be doing, apart from the patch below, in order to build plovr with `ant jar` using JDK 1.8?

Without this change, when building on OS X with the Java SE Development Kit 8, I get:

compile:
    [javac] Compiling 7 source files to /Users/hblanks/git/packages/build/sources/raw/macosx-10.10-intel/plovr/build/classes
    [javac] warning: [options] bootstrap class path not set in conjunction with -source 1.7
    [javac] error: warnings found and -Werror specified
    [javac] error: warnings found and -Werror specified
    [javac] error: warnings found and -Werror specified
    [javac] 3 errors
    [javac] 1 warning

Thanks much!

HJB

$ javac -version
javac 1.8.0_45


diff --git a/build.xml b/build.xmlindex 6ee63c9..478d0c5 100644
--- a/build.xml
+++ b/build.xml
@@ -91,8 +91,8 @@
            classpathref="plovr.classpath"
            debug="on"
            fork="false"
-           target="1.7"
-           source="1.7"
+           target="1.8"
+           source="1.8"
            includeantruntime="false"
            encoding="UTF-8"
            >
@@ -104,8 +104,8 @@
            classpathref="plovr.classpath"
            debug="on"
            deprecation="on"
-           target="1.7"
-           source="1.7"
+           target="1.8"
+           source="1.8"
            includeantruntime="true"
            encoding="UTF-8"
            > 
@@ -118,8 +118,8 @@
            classpathref="plovr.classpath"
            debug="on"
            deprecation="on"
-           target="1.7"
-           source="1.7"
+           target="1.8"
+           source="1.8"
            includeantruntime="true"
            encoding="UTF-8"
            > 

Nick Santos

unread,
Jul 8, 2015, 9:56:11 PM7/8/15
to pl...@googlegroups.com
I haven't tried java8, but the error message seemed self-explanatory
to me. Did you not see the error message, or not understand it, or are
just looking for additional information on it?
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "plovr" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to plovr+un...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Hunter Blanks

unread,
Jul 9, 2015, 1:37:27 PM7/9/15
to pl...@googlegroups.com
Nick,

Thank you for your reply. I've spent some years with Python and indeed with the jscompiler and closure library. But with Java, alas, none at all.

As I understood it, I got this warning ("bootstrap class path not set in conjunction with -source 1.7", which was then raised up to an error), because I hadn't pointed ant (presumably through $JAVA_HOME) to a working 1.7 JDK. And it wants the 1.7 JDK, since build.xml specifies both source and target = 1.7.

What's wasn't quite clear was build.xml needed to specify the source JDK and target JVM for its three compilation targets (closure-stylesheets, closure compiler + templates, and plovr itself). Is there anything about these projects that precludes using Java 8? Or were the 1.7 attributes set just to prevent building with a JDK < 1.7?

And if plovr can be built with Java 8, is there any change I can offer to build.xml so that we can build plovr with ant without having to alter build.xml? Removing the source / target attributes from these there <javac> elements seems to do the trick, but I know too little about Ant and building Java in general to think that's actually a good idea. What would be?

HJB

You received this message because you are subscribed to a topic in the Google Groups "plovr" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/plovr/4wKzHWrA3fQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to plovr+un...@googlegroups.com.

Hunter Blanks

unread,
Jul 9, 2015, 1:39:50 PM7/9/15
to pl...@googlegroups.com
Alas. There were two typos in this. Corrected.


Nick,

Thank you for your reply. I've spent some years with Python and indeed with the jscompiler and closure library. But with Java, alas, none at all.

As I understood it, I got this warning ("bootstrap class path not set in conjunction with -source 1.7", which was then raised up to an error), because I hadn't pointed ant (presumably through $JAVA_HOME) to a working 1.7 JDK. And it wants the 1.7 JDK, sincebuild.xml specifies both source and target = 1.7.

What's wasn't quite clear was why build.xml needed to specify the source JDK and target JVM for its three compilation targets (closure-stylesheets, closure compiler + templates, and plovr itself). Is there anything about these projects that precludes using Java 8? Or were the 1.7 attributes set just to prevent building with a JDK < 1.7?

And if plovr can be built with Java 8, is there any change I can offer to build.xml so that we can build plovr with ant without having to alter build.xml ourselves prior to building? Removing the source / target attributes from these three <javac> elements seems to do the trick, but I know too little about Ant and building Java in general to think that's actually a good idea. What would be?

HJB

Nick Santos

unread,
Jul 9, 2015, 10:18:53 PM7/9/15
to pl...@googlegroups.com
Yes, removing the explicit source and target would probably be fine.
Does it work if you do that?

Hunter Blanks

unread,
Jul 9, 2015, 11:35:54 PM7/9/15
to pl...@googlegroups.com
Nick,

Thanks for writing. Yes, removing the explicit source and target worked for both Java 7 (running OpenJDK, as installed on Ubunut 12.04) and Java 8 (running Oracle's Java on Mavericks).

HJB

You received this message because you are subscribed to a topic in the Google Groups "plovr" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/plovr/4wKzHWrA3fQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to plovr+un...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages