Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.6.3 build error on RHEL 7 and 8 #375

Closed
devrimgunduz opened this issue Oct 13, 2021 · 4 comments
Closed

1.6.3 build error on RHEL 7 and 8 #375

devrimgunduz opened this issue Oct 13, 2021 · 4 comments

Comments

@devrimgunduz
Copy link

Hi

RPM builds are failing on RHEL 7 and 8. Below is the output. Same version builds fine on Fedora, which is quite interesting, because both RHEL 8 and Fedora 34 have the same Java version:

Fedora and RHEL 8:

$ java -version
openjdk version "11.0.12" 2021-07-20
OpenJDK Runtime Environment 18.9 (build 11.0.12+7)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.12+7, mixed mode, sharing)

RHEL 7:
$ java -version
openjdk version "1.8.0_302"
OpenJDK Runtime Environment (build 1.8.0_302-b08)
OpenJDK 64-Bit Server VM (build 25.302-b08, mixed mode)

Any ideas what am I missing? Logs are here:

mvn clean install -Dso.debug=true -Psaxon-examples
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] PostgreSQL PL/Java [pom]
[INFO] PL/Java API [jar]
[INFO] PL/Java backend Java code [jar]
[INFO] PL/Java PGXS [maven-plugin]
[INFO] PL/Java backend native code [pom]
[INFO] PL/Java Ant tasks [jar]
[INFO] PL/Java examples [jar]
[INFO] PL/Java packaging [pom]
[INFO]
[INFO] ---------------------< org.postgresql:pljava.app >----------------------
[INFO] Building PostgreSQL PL/Java 1.6.3 [1/8]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ pljava.app ---
[INFO]
[INFO] --- maven-site-plugin:3.9.1:attach-descriptor (attach-descriptor) @ pljava.app ---
[INFO] Attaching 'src/site/site.xml' site descriptor with classifier 'site'.
[INFO]
[INFO] --- maven-install-plugin:2.5.2:install (default-install) @ pljava.app ---
[INFO] Installing /var/lib/pgsql/rpm13/BUILD/pljava-1_6_3/pom.xml to /var/lib/pgsql/.m2/repository/org/postgresql/pljava.app/1.6.3/pljava.app-1.6.3.pom
[INFO] Installing /var/lib/pgsql/rpm13/BUILD/pljava-1_6_3/target/pljava.app-1.6.3-site.xml to /var/lib/pgsql/.m2/repository/org/postgresql/pljava.app/1.6.3/pljava.app-1.6.3-site.xml
[INFO]
[INFO] ---------------------< org.postgresql:pljava-api >----------------------
[INFO] Building PL/Java API 1.6.3 [2/8]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ pljava-api ---
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ pljava-api ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /var/lib/pgsql/rpm13/BUILD/pljava-1_6_3/pljava-api/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ pljava-api ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 32 source files to /var/lib/pgsql/rpm13/BUILD/pljava-1_6_3/pljava-api/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] PostgreSQL PL/Java 1.6.3 ........................... SUCCESS [ 1.271 s]
[INFO] PL/Java API ........................................ FAILURE [ 0.307 s]
[INFO] PL/Java backend Java code .......................... SKIPPED
[INFO] PL/Java PGXS ....................................... SKIPPED
[INFO] PL/Java backend native code ........................ SKIPPED
[INFO] PL/Java Ant tasks .................................. SKIPPED
[INFO] PL/Java examples ................................... SKIPPED
[INFO] PL/Java packaging 1.6.3 ............................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.718 s
[INFO] Finished at: 2021-10-13T01:03:22+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project pljava-api: Fatal error compiling: invalid flag: --release -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn -rf :pljava-api
error: Bad exit status from /var/tmp/rpm-tmp.Wm3oFv (%build)

Cheers, Devrim

@jcflack
Copy link
Contributor

jcflack commented Oct 13, 2021

1.6.x requires Java 9 or later (build time and run time), so the RHEL7 failure doesn't surprise me. The Java compiler didn't have the --release flag before Java 9. An RHEL7 package would have to declare a dependency on a later Java.

If it is really the same error on RHEL 8 where java -version reports 11, that is weird. Could the path have been set up somehow so a different version of javac is being found? What does javac -version say?

@jcflack
Copy link
Contributor

jcflack commented Apr 5, 2024

Closed waiting on reporter

@jcflack jcflack closed this as completed Apr 5, 2024
@devrimgunduz
Copy link
Author

Hi,

Sorry, I forgot this :(
I tried with the default (1.8.0) and then:

  • javac --version
    javac 11.0.22

and:

  • javac --version:
    javac 22-ea

They also failed. Same versions build on RHEL 9 and Fedora now.

What about maven? Does it make a difference?

Thanks!

Devrim

@jcflack
Copy link
Contributor

jcflack commented Apr 10, 2024

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project pljava-api: Fatal error compiling: invalid flag: --release -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.

If invalid flag: --release is indeed the error being reported, the Maven build must be finding a Java version earlier than 9. (The --release flag first appeared in 9.) If you see a later version when you run javac --version, then you may have a PATH where that later version's javac is found first, but an older Java version is also installed and being found by Maven.

Maven will use the Java installation pointed to by JAVA_HOME, so by setting that environment variable to any Java 9 or later installation before running Maven, you should get Maven to run on the intended Java version.

You can use the suggested -e flag with Maven to get a full stack trace for the error, which will probably confirm (if you want more confirmation) that an older-than-9 Java version is being used. This comment on the similar-looking issue #385 shows how that can be confirmed.

jcflack added a commit that referenced this issue Oct 6, 2024
Issues #375 and #385 were closed as, essentially, pilot error
(running Maven on a different version of Java than intended),
but it would probably help to document that mvn --version does
report the Java version Maven is using, so that can be easily
checked.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants