Closed UnitedMarsupials closed 3 weeks ago
Agreed.
Reportedly, the -O
is a no-op with current OpenJDK, but it may still be meaning something with other implementations. The -target 8
will produce bytecode usable by JDK8 even if a newer javac
is used -- the Java-code generated by SWIG does not, actually, use any newer Java constructs.
--- Java/Makefile.am 2024-11-25 10:34:42.000000000 -0500
+++ Java/Makefile.am 2025-04-15 13:52:46.053023000 -0400
@@ -23,6 +23,8 @@
if BUILD_JAVA
+JAVAC_FLAGS?= -O -g -source 8 -target 8
+
examples/%.class: examples/%.java QuantLib.jar
- $(JAVAC) -cp QuantLib.jar examples/$*.java
+ $(JAVAC) -cp QuantLib.jar ${JAVAC_FLAGS} examples/$*.java
.PHONY: $(EXAMPLES)
@@ -38,5 +40,5 @@
QuantLib.jar: quantlib_wrap.cpp org/quantlib/*.java
mkdir -p bin
- find org/quantlib -name '*.java' | xargs $(JAVAC) -g -d bin
+ find org/quantlib -name '*.java' | xargs $(JAVAC) ${JAVAC_FLAGS} -d bin
$(JAR) cf QuantLib.jar -C bin org
Thanks. Do you have time to open a pull request? This way you'd be recognized properly as a contributor in the GitHub repo.
This way you'd be recognized properly as a contributor in the GitHub repo.
Maybe, some day I'll have a real contribution. This is not one...
When processing the
.java
files underJava/
, build invokesjavac
with-g
. That may not be desirable -- someone may prefer to build with optimization (however little of that Java is offering), or use a newer JDK to build backwards-compatible class-files (with-target 8
), and so on.The default may still be
-g
, but it should be overwritable from command-line...