Skip to content

Tag: gradle

How can I fix NoClassDefFoundError when using Spring framework’s WebSocketClient

I am writing a desktop Java application as a web service client. I want to use WebSocket to implement notification “callback” from the server. I am using the Spring framework’s WebSocketStompClient. Below snippet shows how I initialize it: It works perfectly if I run it in IntelliJ IDE, however, if I run by command line “java -cp my.jar MyPackage.MyMainClass”, it

Gradle project builds successfully but IntelliJ cannot resolve references

Every usage of the following Kotlin library compiles and can be used, but IntelliJ’s autocomplete (and perhaps others) cannot resolve the references. I am using it as a dependency via JitPack: JDK 11, Gradle 6.3 (wrapper) The gradle project builds fine but just autocompletion is broken. Other dependencies like kotlinx.coroutines work fine. It altv-kotlin is a fatjar and

Exporting apache netbeans gradle project to jar file

I have created a Netbeans Gradle project, and I am trying to find the best way to export this to a .jar file so that it can be opened from outside the IDE. I am using dependencies within my project, and I was receiving a java.lang.NoClassDefFoundError. To resolve this, I tried adding to my build.gradle file. However, this threw a

Change “bootJar” target directory

New to gradle, facing issues in jenkins pipeline. Entire build is successful but not able to find the bootable jar of my spring project. If you can please let me know how can I move the jar from target/lib/ to /target folder. Below is my build.gradle P.S- I tried project.buildDir but that changed the build to target, the jar is

Does have access to environment variables

I looked around and could not find any way of accessing environment variables in my What I can do: In my build.gradle I can access environment variables like this System.getenv(“MY_VAR”). I would like to do the same in my Example of what I want to do: In my replace with“BAR”) So far all my attempts

Gradle build – add module path

My question: How do I set a module path for gradle build? I’ve become comfortable working with Java modules from the command line. I do a frequent exercise in Powershell which results in these source files. appMod/module-info appMod/appPack.Entry greetMod/module-info greetMod/greetPack.Hello Since the appMod module requires greetMod, I compile and jar greetMod first. Then I compile and jar appMod, but as