RamSaw / SoftwareDesign

Repository for software design course assignments
MIT License
0 stars 1 forks source link

Make possible to launch server and client without IDEA #16

Closed RamSaw closed 5 years ago

RamSaw commented 5 years ago

Create the ability to run our application in the terminal. Possible solutions:

  1. ./gradlew build, then after that two jars (server and client) created in /build/libs/.
  2. create gradle task. something like that: ./gradlew run client
  3. Find out why created sh files in /build/tmp do not run. Error: ./roguelike-server Error: Could not find or load main class ru.hse.spb.server.RoguelikeServer Caused by: java.lang.ClassNotFoundException: ru.hse.spb.server.RoguelikeServer
VadimFarutin commented 5 years ago

Added corresponding gradle jar tasks: ./gradlew serverJar ./gradlew clientJar

Possible cause of the problem with sh files: main method was not in a separate file as it should be in Kotlin.

RamSaw commented 5 years ago

I can't run it.

Server: java -jar ./build/libs/roguelike-client-1.0-SNAPSHOT.jar localhost 50051 Exception in thread "main" java.lang.NoClassDefFoundError: io/grpc/ManagedChannelBuilder at ru.hse.spb.client.RoguelikeClient.<init>(RoguelikeClient.kt:74) at ru.hse.spb.client.RoguelikeClientApplicationKt.main(RoguelikeClientApplication.kt:14) Caused by: java.lang.ClassNotFoundException: io.grpc.ManagedChannelBuilder at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ... 2 more

Client: java -jar ./build/libs/roguelike-client-1.0-SNAPSHOT.jar localhost 50051 Exception in thread "main" java.lang.NoClassDefFoundError: io/grpc/ManagedChannelBuilder at ru.hse.spb.client.RoguelikeClient.<init>(RoguelikeClient.kt:74) at ru.hse.spb.client.RoguelikeClientApplicationKt.main(RoguelikeClientApplication.kt:14) Caused by: java.lang.ClassNotFoundException: io.grpc.ManagedChannelBuilder at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ... 2 more

@vladimirrim could test it on your linux? maybe the problem is in my system and I haven't installed some gRPC dependencies. @VadimFarutin have you succeeded to run sh files?

VadimFarutin commented 5 years ago

@RamSaw Please try again: ./gradlew clean build ./gradlew serverJar ./gradlew clientJar

I have changed dependency on gRPC to compile one here

RamSaw commented 5 years ago

yeah, now it works. I'm closing issue and will add this info to README.