Closed tedneward closed 3 years ago
Hi @tedneward ,
What errors are you seeing? gradlew build
works for me using JDK 8:
openjdk version "1.8.0_232"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_232-b09)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.232-b09, mixed mode)
I know there were some breaking changes in later versions of Java (I seem to recall JavaFX has been unbundled, for example). I should probably specify compatible JDK versions (or update the build instructions for current ones).
I will take a spin at it using 8, then, before I start going down a rabbit hole (and leading others with me 😊 ).
Some of the errors seemed related to using the right version of Gradle, mostly version mismatches.
I was wondering if the Java9 module system was responsible for some of the breakage, but then I saw some other posts which seemed to imply that people had gotten it to build with more recent versions, which was finally what led me to just pop up and ask.
Thanks for the response!
From: Matt DeFano @.> Sent: Wednesday, June 9, 2021 07:18 To: defano/wyldcard @.> Cc: Ted Neward @.>; Mention @.> Subject: Re: [defano/wyldcard] Help building? (#80)
Hi @tedneward https://github.com/tedneward ,
What errors are you seeing? gradlew build works for me using JDK 8:
openjdk version "1.8.0_232" OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_232-b09) OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.232-b09, mixed mode)
I know there were some breaking changes in later versions of Java (I seem to recall JavaFX has been unbundled, for example). I should probably specify compatible JDK versions (or update the build instructions for current ones).
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/defano/wyldcard/issues/80#issuecomment-857733809 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AAARJFKGZV5BWMEZWC4G2RDTR5ZZNANCNFSM46LIF2PQ .
Just took another crack at it using JDK 8 (inside the Ubuntu environment in WSL, if that makes a difference--it shouldn't, though), and got these two errors:
Could not determine the dependencies of task ':jar'.
Could not resolve all files for configuration ':runtime'. Could not download aspectjrt.jar (org.aspectj:aspectjrt:1.8.13) Could not get resource 'https://repo.maven.apache.org/maven2/org/aspectj/aspectjrt/1.8.13/aspectjrt-1.8.13.jar'. Tag mismatch! Could not download groovy-all.jar (org.codehaus.groovy:groovy-all:2.4.5) Could not get resource 'https://repo.maven.apache.org/maven2/org/codehaus/groovy/groovy-all/2.4.5/groovy-all-2.4.5.jar'. Tag mismatch!
This was from a fresh "git clone" of the project tonight. OpenJDK 1.8.0_242-b08.
Oh, now, this is interesting--just did a clean build on a different machine, and it worked fine. Not sure what the difference is, but wanted to be clear that I got a good build.
Any help appreciated.
My goal is to run the app to create content on modern macOS.
Just did a build on macOS Big Sur with JDK 8 (and also OpenJDK 16.0.1) using:
./gradlew build
And get the following error:
❯ ./gradlew build
> Task :compileJava FAILED
/Volumes/External/Users/matt/Projects/wyldcard/src/main/java/com/defano/wyldcard/part/model/PartModel.java:28: error: package javax.annotation does not exist
import javax.annotation.PostConstruct;
^
/Volumes/External/Users/matt/Projects/wyldcard/src/main/java/com/defano/wyldcard/property/SimplePropertiesModel.java:15: error: package javax.annotation does not exist
import javax.annotation.PostConstruct;
^
/Volumes/External/Users/matt/Projects/wyldcard/src/main/java/com/defano/wyldcard/part/stack/StackModel.java:25: error: package javax.annotation does not exist
import javax.annotation.PostConstruct;
^
/Volumes/External/Users/matt/Projects/wyldcard/src/main/java/com/defano/wyldcard/part/bkgnd/BackgroundModel.java:20: error: package javax.annotation does not exist
import javax.annotation.PostConstruct;
^
/Volumes/External/Users/matt/Projects/wyldcard/src/main/java/com/defano/wyldcard/part/card/CardModel.java:21: error: package javax.annotation does not exist
import javax.annotation.PostConstruct;
^
/Volumes/External/Users/matt/Projects/wyldcard/src/main/java/com/defano/wyldcard/part/field/FieldModel.java:20: error: package javax.annotation does not exist
import javax.annotation.PostConstruct;
^
/Volumes/External/Users/matt/Projects/wyldcard/src/main/java/com/defano/wyldcard/part/card/CardLayerPartModel.java:14: error: package javax.annotation does not exist
import javax.annotation.PostConstruct;
^
/Volumes/External/Users/matt/Projects/wyldcard/src/main/java/com/defano/wyldcard/part/button/ButtonModel.java:13: error: package javax.annotation does not exist
import javax.annotation.PostConstruct;
^
/Volumes/External/Users/matt/Projects/wyldcard/src/main/java/com/defano/wyldcard/serializer/PostConstructAdapterFactory.java:23: error: package javax.annotation does not exist
import javax.annotation.PostConstruct;
^
/Volumes/External/Users/matt/Projects/wyldcard/src/main/java/com/defano/wyldcard/part/wyldcard/WyldCardPart.java:29: error: package javax.annotation does not exist
import javax.annotation.PostConstruct;
^
/Volumes/External/Users/matt/Projects/wyldcard/src/main/java/com/defano/wyldcard/part/model/PartModel.java:102: error: cannot find symbol
@PostConstruct
^
symbol: class PostConstruct
location: class PartModel
/Volumes/External/Users/matt/Projects/wyldcard/src/main/java/com/defano/wyldcard/part/stack/StackModel.java:72: error: cannot find symbol
@PostConstruct
^
symbol: class PostConstruct
location: class StackModel
/Volumes/External/Users/matt/Projects/wyldcard/src/main/java/com/defano/wyldcard/part/card/CardModel.java:74: error: cannot find symbol
@PostConstruct
^
symbol: class PostConstruct
location: class CardModel
/Volumes/External/Users/matt/Projects/wyldcard/src/main/java/com/defano/wyldcard/part/button/ButtonModel.java:71: error: cannot find symbol
@PostConstruct
^
symbol: class PostConstruct
location: class ButtonModel
/Volumes/External/Users/matt/Projects/wyldcard/src/main/java/com/defano/wyldcard/part/field/FieldModel.java:127: error: cannot find symbol
@PostConstruct
^
symbol: class PostConstruct
location: class FieldModel
/Volumes/External/Users/matt/Projects/wyldcard/src/main/java/com/defano/wyldcard/part/card/CardLayerPartModel.java:57: error: cannot find symbol
@PostConstruct
^
symbol: class PostConstruct
location: class CardLayerPartModel
/Volumes/External/Users/matt/Projects/wyldcard/src/main/java/com/defano/wyldcard/part/bkgnd/BackgroundModel.java:59: error: cannot find symbol
@PostConstruct
^
symbol: class PostConstruct
location: class BackgroundModel
/Volumes/External/Users/matt/Projects/wyldcard/src/main/java/com/defano/wyldcard/property/SimplePropertiesModel.java:27: error: cannot find symbol
@PostConstruct
^
symbol: class PostConstruct
location: class SimplePropertiesModel
/Volumes/External/Users/matt/Projects/wyldcard/src/main/java/com/defano/wyldcard/part/wyldcard/WyldCardPart.java:124: error: cannot find symbol
@PostConstruct
^
symbol: class PostConstruct
location: class WyldCardPart
/Volumes/External/Users/matt/Projects/wyldcard/src/main/java/com/defano/wyldcard/serializer/PostConstructAdapterFactory.java:44: error: cannot find symbol
if (m.isAnnotationPresent(PostConstruct.class)) {
^
symbol: class PostConstruct
location: class PostConstructAdapterFactory
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
20 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 3s
2 actionable tasks: 2 executed
Hi @gingerbeardman , those errors look to me like you're compiling with a version of Java newer than 8. I believe the javax
package was eliminated from the JDK in Java 11. Alternately, I suspect you could fix this error by adding this JAR to the build: https://mvnrepository.com/artifact/javax.annotation/javax.annotation-api/1.3.2
I need to spend some time bringing the project up-to-date with the latest Java releases.
Feel free to submit a PR with your changes if you get this cleaned up. :)
Sadly not being into Java I have no idea what any of that means 😅
But I'll look into it
Have had a go but no joy.
Try this:
curl -s "https://get.sdkman.io" | bash
sdk install java 8.0.232.hs-adpt
sdk use java 8.0.232.hs-adpt
./gradlew run
There's a bit more that needs to be updated than simply adding the javax
package dependency when trying to use a modern version of Java. I need to clean that up...
Thanks!
I get:
Stop! java 8.0.232.hs-adpt is not available. Possible causes:
* 8.0.232.hs-adpt is an invalid version
* java binaries are incompatible with your platform
* java has not been released yet
Tip: see all available versions for your platform:
$ sdk list java
And so:
sdk list java
================================================================================
Available Java Versions
================================================================================
Vendor | Use | Version | Dist | Status | Identifier
--------------------------------------------------------------------------------
AdoptOpenJDK | | 16.0.1.j9 | adpt | | 16.0.1.j9-adpt
| | 16.0.1.hs | adpt | | 16.0.1.hs-adpt
| | 11.0.11.j9 | adpt | | 11.0.11.j9-adpt
| | 11.0.11.hs | adpt | | 11.0.11.hs-adpt
| | 8.0.292.j9 | adpt | | 8.0.292.j9-adpt
| | 8.0.292.hs | adpt | | 8.0.292.hs-adpt
Amazon | | 16.0.2.7.1 | amzn | | 16.0.2.7.1-amzn
| | 11.0.12.7.2 | amzn | | 11.0.12.7.2-amzn
| | 8.302.08.1 | amzn | | 8.302.08.1-amzn
Azul Zulu | | 16.0.2 | zulu | | 16.0.2-zulu
| | 16.0.2.fx | zulu | | 16.0.2.fx-zulu
| | 11.0.12 | zulu | | 11.0.12-zulu
| | 11.0.12.fx | zulu | | 11.0.12.fx-zulu
| | 8.0.302 | zulu | | 8.0.302-zulu
| | 8.0.302.fx | zulu | | 8.0.302.fx-zulu
| | 7.0.312 | zulu | | 7.0.312-zulu
BellSoft | | 16.0.2.fx | librca | | 16.0.2.fx-librca
| | 16.0.2 | librca | | 16.0.2-librca
| | 11.0.12.fx | librca | | 11.0.12.fx-librca
| | 11.0.12 | librca | | 11.0.12-librca
| | 8.0.302.fx | librca | | 8.0.302.fx-librca
| | 8.0.302 | librca | | 8.0.302-librca
GraalVM | | 21.2.0.r16 | grl | | 21.2.0.r16-grl
| | 21.2.0.r11 | grl | | 21.2.0.r11-grl
| | 20.3.3.r11 | grl | | 20.3.3.r11-grl
| | 19.3.6.r11 | grl | | 19.3.6.r11-grl
Java.net | | 18.ea.9 | open | | 18.ea.9-open
| | 17.ea.33 | open | | 17.ea.33-open
| | 17.ea.7.lm | open | | 17.ea.7.lm-open
| | 17.ea.3.pma | open | | 17.ea.3.pma-open
| | 16.0.2 | open | | 16.0.2-open
| | 11.0.2 | open | | 11.0.2-open
Microsoft | | 16.0.2.7.1 | ms | | 16.0.2.7.1-ms
| | 16.0.1.9.1 | ms | | 16.0.1.9.1-ms
| | 11.0.12.7.1 | ms | | 11.0.12.7.1-ms
| | 11.0.11.9.1 | ms | | 11.0.11.9.1-ms
SAP | | 16.0.2 | sapmchn | | 16.0.2-sapmchn
| | 11.0.12 | sapmchn | | 11.0.12-sapmchn
Temurin | | 16.0.2 | tem | | 16.0.2-tem
| | 11.0.12 | tem | | 11.0.12-tem
| | 8.0.302 | tem | | 8.0.302-tem
TravaOpenJDK | | 11.0.9 | trava | | 11.0.9-trava
| | 8.0.232 | trava | | 8.0.232-trava
================================================================================
Use the Identifier for installation:
$ sdk install java 11.0.3.hs-adpt
================================================================================
So I went with
8.0.292.hs-adpt
Interesting... Try using 8.0.292.hs-adpt
(instead of 8.0.232.hs-adpt
)
Just edited my comment to say I did just that.
Success!
Thanks again.
Awesome! Glad its working for you.
Doing a straight "gradlew build" is running into some version mismatches--has this been built recently, and if so, with which version of the JDK and which version of Gradle? Were any changes to build.gradle required?