cryptic-game / java-backend-old

This is the Java Backend of the Cryptic project.

Home Page:https://cryptic-game.github.io/java-backend

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Update README for current enviroment

cadamini opened this issue · comments

I wanted to try building the project by following the readme on Windows and had some problems.

Here's what I did:

  1. I have cloned the project
  2. I installed the IntelliJ IDE and JDK 11 from https://www.oracle.com/java/technologies/downloads/#java11
  3. Saw some issues running some test builds (see below)
  4. I struggled to find the right tasks to run.
  5. I struggled to configure the IntelliJ IDE.

Note: I have updated my post after I could manage to get the current tasks in IntelliJ, see my last comment.

Below you can find an unsorted list of things I encountered while setting up the project.

1. Error(s) running gradle/gradlew

I got messages like:

  • Gradle sync failed: Unable to start the daemon process
  • Error:Unable to start the daemon process.
  • Could not create the Java Virtual Machine

I could solve them with a little configuration change, see https://stackoverflow.com/a/34734684/3842598

2. The command gradlew tasks does not show the tasks described in the readme

The readme contains:

Server:
./gradlew :server:start

Java-Daemon:
./gradlew :java-daemon:start

Admin-Panel:
./gradlew :admin-panel:start

I used gradlew :server:tasks --all to check all available tasks. I have no idea what all the other tasks are for. Is there an alternative to the above? I successfully tried to run gradlew build but failed with gradlew :server:bootRun (see below)

3. RuntimeException in :server:compileJava when running gradlew server:bootRun

Execution failed for task ':server:compileJava'.

java.lang.RuntimeException: Unable to find config value "IS_THIS_ADUMMYVALUE".

Removed this (as a workaround?):

@ConfigValue
private static final Boolean IS_THIS_ADUMMYVALUE = true;

4. Warnings

I know warnings are just warnings. no errors, but I'd like to mention "no comment" warnings from javadoc, a gradle warning after build about "deprecated Gradle features used in this build, making it incompatible with Gradle 8.0", and some other warnings, e.g.

> ..\java-backend\java-base\src\main\java\net\cryptic_game\backend\base\daemon\DaemonEndpointData.java:13: warning: Generating equals/hashCode implementation but without a call to superclass, even though this class does not extend java.lang.Object. If this is intentional, add '@EqualsAndHashCode(callSuper=false)' to your type.
> @EqualsAndHashCode

5. Project requirements need an update

It seems the project requirements are outdated, I think you need at least:

  • postgresql
  • spring ?
  • redis ?

Thanks for the feedback. We recently moved to spring boot and forgot to update the readme. I am going to address this in the next dayd.

btw. we included some IntelliJ run configuration wich should work: https://github.com/cryptic-game/java-backend/tree/master/.run On the top right you have a dropdown where you can select the one you like to run (green play button)

GitHub
This is the Java Backend of the Cryptic project. Contribute to cryptic-game/java-backend development by creating an account on GitHub.

Ok, got it. I ran the mentioned "Assemble" task but got Assemble: failed with the following message:

Execution failed for task ':config-processor:compileJava'.
invalid source release: 11

I have installed Java 11 for Windows, see below:

C:\Users\User>java -version
openjdk version "11.0.13" 2021-10-19 LTS
OpenJDK Runtime Environment Microsoft-27990 (build 11.0.13+8-LTS)
OpenJDK 64-Bit Server VM Microsoft-27990 (build 11.0.13+8-LTS, mixed mode)

Both the project and dependencies are configured to use Java 11:

java11-project

The top right of the screen below shows the file Assemble.run.xml

java

Any suggestions?

do you have the latest version of the master branch and have you tried reloading gradle

First of all, thank you! I solved it. Your tip with reloading gradle was great. Found some resources on how to work with gradle. Next, I up(down)graded by gradle version using: ./gradlew wrapper --gradle-version 7.3.2.

After this, running ./gradlew --version showed Gradle 7.3.2. Then, the command gradlew.bat build succeeded on my command line showing BUILD SUCCESSFUL in 1m 43s.

At this time, I had still no luck with the Assemble task, same error, still a configuration issue in IntelliJ? It turned out to be the JVM configured for Gradle:

  1. I found this SO article.
  2. I checked and changed the Gradle JVM in my local IntelliJ config to:
    gradle-jvm
  3. Rebuild, and succeeded in building the project in IntelliJ.
    run-task-successful

Definitely include the three JVM settings configurations in the docs.

Ok, then you probebly don't have the latest version of intellij. I thought that this option was removed with one of the last versions and now defaults to the project sdk.

I downloaded the community edition, see https://www.jetbrains.com/idea/download/.