You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by "Randolph M. Fritz" <rm...@gmail.com> on 2020/07/06 23:15:38 UTC

Building Examples

I'm using Netbeans 12.0 and OpenJDK 13. I have downloaded the pdfbox 2.20
examples, but when I try to build them, I get a complaint:

--- maven-enforcer-plugin:1.4.1:enforce (default) @ pdfbox-examples ---
Rule 1: org.apache.maven.plugins.enforcer.RequireJavaVersion failed with
message:
Requires at least Java 7, and Java versions higher than 11 cannot build
Java 6 bytecode

Is there some option I can set (I have tried quite a few) that will make
these build in my environment, or do I just have to use the trunk version
of pdfbox?
-- 
Randolph M. Fritz || +1 206 659-8617 || rmfritz3@gmail.com

Re: Building Examples

Posted by "Randolph M. Fritz" <rm...@gmail.com>.
And it turns out you also need this patch for the example pom.xml. Sorry
for the multiple emails.

# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- a/pom.xml
+++ b/pom.xml
@@ -144,6 +144,15 @@
               <argLine>${addmod}</argLine>
           </configuration>
       </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>2.3.2</version>
+        <configuration>
+          <source>1.8</source>
+          <target>1.8</target>
+        </configuration>
+      </plugin>
     </plugins>
   </build>

-- 
Randolph M. Fritz || +1 206 659-8617 || rmfritz3@gmail.com


On Tue, Jul 7, 2020 at 1:02 PM Randolph M. Fritz <rm...@gmail.com> wrote:

> A simpler version, for anyone who needs it, is just this:
> # This patch file was generated by NetBeans IDE
> # It uses platform neutral UTF-8 encoding and \n newlines.
> --- a/pom.xml
> +++ b/pom.xml
> @@ -336,10 +336,8 @@
>                                          <version>3.1</version>
>                                      </requireMavenVersion>
>                                      <requireJavaVersion>
> -                                        <version>[1.7,12)</version>
> -                                        <message>Requires at least Java
> 7, and
> -                                            Java versions higher than 11
> cannot
> -                                            build Java 6
> bytecode</message>
> +                                        <version>[1.7,)</version>
> +                                        <message>Requires at least Java
> 7.</message>
>                                      </requireJavaVersion>
>                                    </rules>
>                              </configuration>
> --
> Randolph M. Fritz || +1 206 659-8617 || rmfritz3@gmail.com
>
>
> On Mon, Jul 6, 2020 at 9:38 PM Randolph Fritz <rm...@gmail.com> wrote:
>
>> Thank you! That led me right to the problem. The Maven plugin
>> configuration in the parent specifically forbids a Java version higher than
>> 11. Since my target is JDK 9, I don’t care about JDK 6 bytecode anyway, so
>> I relaxed that rule and it built fine.
>>
>> Diff:
>>
>> # This patch file was generated by NetBeans IDE
>> # It uses platform neutral UTF-8 encoding and \n newlines.
>> --- a/pom.xml
>> +++ b/pom.xml
>> @@ -229,8 +229,8 @@
>>                  <!-- fails with maven 3.6.0 on jdk 6, works with 3.2.1,
>> 3.5.0 and 3.5.2 -->
>>                  <configuration>
>>                      <showDeprecation>true</showDeprecation>
>> -                    <target>1.6</target>
>> -                    <source>1.6</source>
>> +                    <target>9</target>
>> +                    <source>9</source>
>>                      <encoding>UTF-8</encoding>
>>                      <!--
>> https://maven.apache.org/plugins/maven-compiler-plugin/examples/compile-using-different-jdk.html
>> -->
>>                      <executable>${jdk.path}/bin/javac</executable>
>> @@ -325,6 +325,7 @@
>>              <plugins>
>>                  <plugin>
>>                      <artifactId>maven-enforcer-plugin</artifactId>
>> +                    <version>3.0.0-M3</version>
>>                      <executions>
>>                          <execution>
>>                              <goals>
>> @@ -336,10 +337,8 @@
>>                                          <version>3.1</version>
>>                                      </requireMavenVersion>
>>                                      <requireJavaVersion>
>> -                                        <version>[1.7,12)</version>
>> -                                        <message>Requires at least Java
>> 7, and
>> -                                            Java versions higher than 11
>> cannot
>> -                                            build Java 6
>> bytecode</message>
>> +                                        <version>[1.7,)</version>
>> +                                        <message>Requires at least Java
>> 7</message>
>>                                      </requireJavaVersion>
>>                                    </rules>
>>                              </configuration>
>>
>>
>>
>> --
>> Randolph
>>
>> On Jul 6, 2020, at 8:29 PM, Tilman Hausherr <TH...@t-online.de>
>> wrote:
>>
>> Could you try to set a newer version for
>>
>> maven-enforcer-plugin
>>
>>
>> in the parent pom.xml?  3.0.0-M3  is the one we're using for the trunk.
>> 1.4.1 is the previous one, really.
>>
>> Tilman
>>
>> Am 07.07.2020 um 01:15 schrieb Randolph M. Fritz:
>>
>> I'm using Netbeans 12.0 and OpenJDK 13. I have downloaded the pdfbox 2.20
>> examples, but when I try to build them, I get a complaint:
>>
>> --- maven-enforcer-plugin:1.4.1:enforce (default) @ pdfbox-examples ---
>> Rule 1: org.apache.maven.plugins.enforcer.RequireJavaVersion failed with
>> message:
>> Requires at least Java 7, and Java versions higher than 11 cannot build
>> Java 6 bytecode
>>
>> Is there some option I can set (I have tried quite a few) that will make
>> these build in my environment, or do I just have to use the trunk version
>> of pdfbox?
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>
>>
>>

Re: Building Examples

Posted by "Randolph M. Fritz" <rm...@gmail.com>.
A simpler version, for anyone who needs it, is just this:
# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- a/pom.xml
+++ b/pom.xml
@@ -336,10 +336,8 @@
                                         <version>3.1</version>
                                     </requireMavenVersion>
                                     <requireJavaVersion>
-                                        <version>[1.7,12)</version>
-                                        <message>Requires at least Java 7,
and
-                                            Java versions higher than 11
cannot
-                                            build Java 6 bytecode</message>
+                                        <version>[1.7,)</version>
+                                        <message>Requires at least Java
7.</message>
                                     </requireJavaVersion>
                                   </rules>
                             </configuration>
-- 
Randolph M. Fritz || +1 206 659-8617 || rmfritz3@gmail.com


On Mon, Jul 6, 2020 at 9:38 PM Randolph Fritz <rm...@gmail.com> wrote:

> Thank you! That led me right to the problem. The Maven plugin
> configuration in the parent specifically forbids a Java version higher than
> 11. Since my target is JDK 9, I don’t care about JDK 6 bytecode anyway, so
> I relaxed that rule and it built fine.
>
> Diff:
>
> # This patch file was generated by NetBeans IDE
> # It uses platform neutral UTF-8 encoding and \n newlines.
> --- a/pom.xml
> +++ b/pom.xml
> @@ -229,8 +229,8 @@
>                  <!-- fails with maven 3.6.0 on jdk 6, works with 3.2.1,
> 3.5.0 and 3.5.2 -->
>                  <configuration>
>                      <showDeprecation>true</showDeprecation>
> -                    <target>1.6</target>
> -                    <source>1.6</source>
> +                    <target>9</target>
> +                    <source>9</source>
>                      <encoding>UTF-8</encoding>
>                      <!--
> https://maven.apache.org/plugins/maven-compiler-plugin/examples/compile-using-different-jdk.html
> -->
>                      <executable>${jdk.path}/bin/javac</executable>
> @@ -325,6 +325,7 @@
>              <plugins>
>                  <plugin>
>                      <artifactId>maven-enforcer-plugin</artifactId>
> +                    <version>3.0.0-M3</version>
>                      <executions>
>                          <execution>
>                              <goals>
> @@ -336,10 +337,8 @@
>                                          <version>3.1</version>
>                                      </requireMavenVersion>
>                                      <requireJavaVersion>
> -                                        <version>[1.7,12)</version>
> -                                        <message>Requires at least Java
> 7, and
> -                                            Java versions higher than 11
> cannot
> -                                            build Java 6
> bytecode</message>
> +                                        <version>[1.7,)</version>
> +                                        <message>Requires at least Java
> 7</message>
>                                      </requireJavaVersion>
>                                    </rules>
>                              </configuration>
>
>
>
> --
> Randolph
>
> On Jul 6, 2020, at 8:29 PM, Tilman Hausherr <TH...@t-online.de> wrote:
>
> Could you try to set a newer version for
>
> maven-enforcer-plugin
>
>
> in the parent pom.xml?  3.0.0-M3  is the one we're using for the trunk.
> 1.4.1 is the previous one, really.
>
> Tilman
>
> Am 07.07.2020 um 01:15 schrieb Randolph M. Fritz:
>
> I'm using Netbeans 12.0 and OpenJDK 13. I have downloaded the pdfbox 2.20
> examples, but when I try to build them, I get a complaint:
>
> --- maven-enforcer-plugin:1.4.1:enforce (default) @ pdfbox-examples ---
> Rule 1: org.apache.maven.plugins.enforcer.RequireJavaVersion failed with
> message:
> Requires at least Java 7, and Java versions higher than 11 cannot build
> Java 6 bytecode
>
> Is there some option I can set (I have tried quite a few) that will make
> these build in my environment, or do I just have to use the trunk version
> of pdfbox?
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>
>
>

Re: Building Examples

Posted by Randolph Fritz <rm...@gmail.com>.
Thank you! That led me right to the problem. The Maven plugin configuration in the parent specifically forbids a Java version higher than 11. Since my target is JDK 9, I don’t care about JDK 6 bytecode anyway, so I relaxed that rule and it built fine.

Diff:

# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- a/pom.xml
+++ b/pom.xml
@@ -229,8 +229,8 @@
                 <!-- fails with maven 3.6.0 on jdk 6, works with 3.2.1, 3.5.0 and 3.5.2 -->
                 <configuration>
                     <showDeprecation>true</showDeprecation>
-                    <target>1.6</target>
-                    <source>1.6</source>
+                    <target>9</target>
+                    <source>9</source>
                     <encoding>UTF-8</encoding>
                     <!-- https://maven.apache.org/plugins/maven-compiler-plugin/examples/compile-using-different-jdk.html -->
                     <executable>${jdk.path}/bin/javac</executable>
@@ -325,6 +325,7 @@
             <plugins>
                 <plugin>
                     <artifactId>maven-enforcer-plugin</artifactId>
+                    <version>3.0.0-M3</version>
                     <executions>
                         <execution>
                             <goals>
@@ -336,10 +337,8 @@
                                         <version>3.1</version>
                                     </requireMavenVersion>
                                     <requireJavaVersion>
-                                        <version>[1.7,12)</version>
-                                        <message>Requires at least Java 7, and
-                                            Java versions higher than 11 cannot
-                                            build Java 6 bytecode</message>
+                                        <version>[1.7,)</version>
+                                        <message>Requires at least Java 7</message>
                                     </requireJavaVersion>
                                   </rules>
                             </configuration>



-- 
Randolph

> On Jul 6, 2020, at 8:29 PM, Tilman Hausherr <TH...@t-online.de> wrote:
> 
> Could you try to set a newer version for
> 
> maven-enforcer-plugin
> 
> 
> in the parent pom.xml?  3.0.0-M3  is the one we're using for the trunk. 1.4.1 is the previous one, really.
> 
> Tilman
> 
> Am 07.07.2020 um 01:15 schrieb Randolph M. Fritz:
>> I'm using Netbeans 12.0 and OpenJDK 13. I have downloaded the pdfbox 2.20
>> examples, but when I try to build them, I get a complaint:
>> 
>> --- maven-enforcer-plugin:1.4.1:enforce (default) @ pdfbox-examples ---
>> Rule 1: org.apache.maven.plugins.enforcer.RequireJavaVersion failed with
>> message:
>> Requires at least Java 7, and Java versions higher than 11 cannot build
>> Java 6 bytecode
>> 
>> Is there some option I can set (I have tried quite a few) that will make
>> these build in my environment, or do I just have to use the trunk version
>> of pdfbox?
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org <ma...@pdfbox.apache.org>
> For additional commands, e-mail: users-help@pdfbox.apache.org <ma...@pdfbox.apache.org>

Re: Building Examples

Posted by Tilman Hausherr <TH...@t-online.de>.
Could you try to set a newer version for

maven-enforcer-plugin


in the parent pom.xml?  3.0.0-M3  is the one we're using for the trunk. 
1.4.1 is the previous one, really.

Tilman

Am 07.07.2020 um 01:15 schrieb Randolph M. Fritz:
> I'm using Netbeans 12.0 and OpenJDK 13. I have downloaded the pdfbox 2.20
> examples, but when I try to build them, I get a complaint:
>
> --- maven-enforcer-plugin:1.4.1:enforce (default) @ pdfbox-examples ---
> Rule 1: org.apache.maven.plugins.enforcer.RequireJavaVersion failed with
> message:
> Requires at least Java 7, and Java versions higher than 11 cannot build
> Java 6 bytecode
>
> Is there some option I can set (I have tried quite a few) that will make
> these build in my environment, or do I just have to use the trunk version
> of pdfbox?



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org