Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Jul 2023 12:14:44 +0000
From:      Marcin Cieslak <saper@saper.info>
To:        java@freebsd.org
Subject:   runtime JAVA_VERSION vs. Java build target
Message-ID:  <3nq41q78-5qo8-1469-1s11-087so5p535q3@fncre.vasb>
Resent-Message-ID: <p26n69nn-6219-oo5r-1qo9-sono25763970@fncre.vasb>

next in thread | raw e-mail | index | archive | help
--2201072851-43873148-1689941684=:935
Content-Type: text/plain; format=flowed; charset=US-ASCII

I've run into this recently:

when I build a Java port, generated JAR will be built
with a compiler set by JAVA_VERSION which is our runtime setting.

For example, when building with OpenJDK 11, and later
running something with env JAVA_VERSION=8 ... I will
get class file version errors.

Since textproc/xincluder is a small and obsolete
piece of software, I have decided to tell javac
to target Java 8 in all cases[1].

Shall this be a general practice? If someone
decides to set JAVA_VERSION high and rebuild
Java dependencies from source (those which can be rebuilt)
- JAVA_VERSION cannot be really used to switch at runtime.

On the other hand, one might the code to be optimized better.

What is the best practice here? Shall we keep JAR libraries
that can be used as dependencies compatible with the oldest
Java runtime we have?

Marcin

[1] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=272559
--2201072851-43873148-1689941684=:935
Content-Type: application/pkcs7-signature; name=smime.p7s
Content-Transfer-Encoding: BASE64
Content-Description: S/MIME Cryptographic Signature
Content-Disposition: attachment; filename=smime.p7s

MIIOdgYJKoZIhvcNAQcCoIIOZzCCDmMCAQExDzANBglghkgBZQMEAgEFADAL
BgkqhkiG9w0BBwGgggq9MIIEvDCCA6SgAwIBAgIQeEqpEhjRpCYIUTzTZlVD
ozANBgkqhkiG9w0BAQsFADBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3Qg
Q0EgLSBSMzETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFs
U2lnbjAeFw0yMDA5MTYwMDAwMDBaFw0yOTAzMTgwMDAwMDBaMFsxCzAJBgNV
BAYTAkJFMRkwFwYDVQQKExBHbG9iYW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A9zPlYrOgWHt9T8yw2mKlMjIiV8
XyPpdHYhTbwRNW1cnkLyIeFUUF3TGHw2WzdRExrau3dU8oLUXbaMMkPOL7z5
bxIZClErrm6Eq5HnUbH+ZENqUNeJq6/+dvUpZkQdQKaEo9LeHaF1cXvXd7dE
nZ6fEHQK22yOw4EQUIDGMFDzgJAZ6i6LBwb6vDTVGYrjdq6kByPCF3N1TK5f
O1wDeF1+sT7TGWZ1e3hfXIyDRXiE+r/M8c/flx3kBYwG3JyJ2OtPtSammwr2
9QAbKQvsP1Sflk4QbVppiXWjfQm1TAiVHvvY0ERBT7cl5xYnrQaggMgSOr1e
pSvV7vmU3h1Ub1YhUvQFWfqvf4tabzDEuh3DLyVD3Fh38GCZTZv6GCHzTEZS
pJuzk7lDxbzlfCX+PvaSUQ==

--2201072851-43873148-1689941684=:935--





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3nq41q78-5qo8-1469-1s11-087so5p535q3>