Bug
antd-java ships runnable example sources at examples/Example01Connect.java, Example02PublicData.java, etc., but they can't be invoked through the gradle wrapper:
$ cd antd-java
$ bash gradlew examples:build --no-daemon
FAILURE: Build failed with an exception.
* What went wrong:
Cannot locate tasks that match 'examples:build' as project 'examples' not found in root project 'antd-java'.
Cause
antd-java/settings.gradle.kts declares only the root project — no subprojects:
rootProject.name = "antd-java"
Compare antd-kotlin/settings.gradle.kts:
rootProject.name = "antd-kotlin"
include("lib")
include("examples")
So antd-kotlin registers the examples as a runnable subproject with its own application plugin and gradlew :examples:run --args=2 works. antd-java doesn't, and currently the only way to compile the example is by hand (javac -cp build/libs/antd-java-*.jar examples/*.java), assembling the right classpath manually.
Fix
Mirror the antd-kotlin layout:
- Move
examples/Example*.java under examples/src/main/java/com/autonomi/examples/.
- Add
examples/build.gradle.kts declaring the application plugin + mainClass.
include("examples") in settings.gradle.kts.
bash gradlew :examples:run -PmainClass=... or --args=... (one entry point per example, matching what antd-kotlin does with Main.kt).
This also gives parity across the JVM SDKs and unblocks the cross-SDK ant dev example dispatcher (see #65).
Pre-existing setup issue (separate ticket?)
Also relevant: antd-java/gradlew is committed without the executable bit; users must chmod +x gradlew before the wrapper will run. antd-kotlin/ is missing the wrapper script and gradle-wrapper.jar entirely (only gradle-wrapper.properties is checked in — see #69). Happy to file these as a single "JVM SDK packaging" issue if preferred.
Environment
- JDK Temurin 17.0.19, gradle 9.4 (from wrapper)
- antd-java at
main
Found via cross-SDK e2e harness.
Bug
antd-javaships runnable example sources atexamples/Example01Connect.java,Example02PublicData.java, etc., but they can't be invoked through the gradle wrapper:Cause
antd-java/settings.gradle.ktsdeclares only the root project — no subprojects:Compare
antd-kotlin/settings.gradle.kts:So
antd-kotlinregisters the examples as a runnable subproject with its ownapplicationplugin andgradlew :examples:run --args=2works.antd-javadoesn't, and currently the only way to compile the example is by hand (javac -cp build/libs/antd-java-*.jar examples/*.java), assembling the right classpath manually.Fix
Mirror the
antd-kotlinlayout:examples/Example*.javaunderexamples/src/main/java/com/autonomi/examples/.examples/build.gradle.ktsdeclaring theapplicationplugin +mainClass.include("examples")insettings.gradle.kts.bash gradlew :examples:run -PmainClass=...or--args=...(one entry point per example, matching whatantd-kotlindoes withMain.kt).This also gives parity across the JVM SDKs and unblocks the cross-SDK
ant dev exampledispatcher (see #65).Pre-existing setup issue (separate ticket?)
Also relevant:
antd-java/gradlewis committed without the executable bit; users mustchmod +x gradlewbefore the wrapper will run.antd-kotlin/is missing the wrapper script andgradle-wrapper.jarentirely (onlygradle-wrapper.propertiesis checked in — see #69). Happy to file these as a single "JVM SDK packaging" issue if preferred.Environment
mainFound via cross-SDK e2e harness.