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

Help building? #80

Closed
tedneward opened this issue Jun 9, 2021 · 13 comments
Closed

Help building? #80

tedneward opened this issue Jun 9, 2021 · 13 comments

Comments

@tedneward
Copy link

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?

@defano
Copy link
Owner

defano commented Jun 9, 2021

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).

@tedneward
Copy link
Author

tedneward commented Jun 11, 2021 via email

@tedneward
Copy link
Author

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.

@tedneward
Copy link
Author

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.

@gingerbeardman
Copy link

gingerbeardman commented Jul 25, 2021

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

@defano
Copy link
Owner

defano commented Jul 26, 2021

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. :)

@gingerbeardman
Copy link

Sadly not being into Java I have no idea what any of that means 😅

But I'll look into it

@gingerbeardman
Copy link

Have had a go but no joy.

@defano
Copy link
Owner

defano commented Aug 7, 2021

Try this:

  1. install, SDKMAN (a Java SDK version manager— https://sdkman.io) by executing curl -s "https://get.sdkman.io" | bash
  2. Install Java 8, sdk install java 8.0.232.hs-adpt
  3. Use that version for your current shell session, sdk use java 8.0.232.hs-adpt
  4. Navigate to the Wyldcard project directory and re-run ./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...

@gingerbeardman
Copy link

gingerbeardman commented Aug 7, 2021

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

@defano
Copy link
Owner

defano commented Aug 7, 2021

Interesting... Try using 8.0.292.hs-adpt (instead of 8.0.232.hs-adpt)

@gingerbeardman
Copy link

gingerbeardman commented Aug 7, 2021

Just edited my comment to say I did just that.

Success!

Thanks again.

Screen shot 2021-08-07 at 22 10 14

@defano
Copy link
Owner

defano commented Aug 7, 2021

Awesome! Glad its working for you.

@defano defano closed this as completed Aug 7, 2021
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

3 participants