Is it possible to generate chainable field mutators in IntelliJ IDEA? Preferably with a prefix other than set to avoid breaking conventions. Let’s say withX is the chainable companion to setX. For example, given this class stub I can use Generate -> Setters to generate a public void setFoo(String foo) method. Is there a similar way to generate a public
Tag: intellij-idea
Integrate Kotlinx coroutines in intelliJ project
I‘m using intellij for a while now. There I work on a javaFx project, which is mainly written in java but I discovered Kotlin to be a nice alternative. Recently I read about coroutines in Kotlin and I just can‘t figure out how to add the Kotlinx library to my project. I can only find the snippets for maven and
Gradle build ignores Jetbrains annotations
Let’s say we have the following test code: The test will pass when running gradle test directly or if IDEA delegates the action to gradle. But it will fail with IllegalArgumentException: Argument for @NotNull parameter ‘value’ must not be null exception if it runs using IDEA runner (not delegated to gradle). The question is: how to fail the test running
How to run single class ignoring compilation error in other class
I am using IntelliJ IDEA 2017.3. I have a project called “test”, which has two classes under the src folder: Main, has main method to print out “Hello World” CompileErrorClass, has one method with compile errors Those two class have no dependencies. I was trying to run the main() in the Main class, and set the before launch to “build,
IntelliJ Idea not resolving Mockito and JUnit dependencies with Maven
I am using IntelliJ idea for writing simple unit test cases using JUnit and Mockito. I am using Maven for dependency management. IntelliJ idea keeps complaining that following imports cannot be resolved: Following is the dependencies section of my project: Following is my project structure: Answer Try View -> Tool Windows -> Maven projects, then click the blue icon in
“NoClassDefFoundError: javax/xml/bind/DatatypeConverter” with SQL Server JDBC
I recently switched to intellij but I’m finding it hard to connect to my localDB. The same code worked on eclipse fine. Also I have already added the sqljdbc42.jar as a module dependency. Error produced: Any help would be greatly appreciated. I’ve also tried the overloaded DriverManager.getConnection(url, user, pass) method and same error. Answer For Java 9+ compatibility, you need
How to display auto-configuration report when running a Spring Boot application
Error starting ApplicationContext. To display the auto-configuration report re-run your application with ‘debug’ enabled I am getting the above message when I try to run my Spring Boot application. Does anyone know how I can re-run the application with ‘debug’ enabled? I am running the application in Intellij (version 2016.1.2) My runner class looks like the following, In response to
Cannot import javax.validation.constraints in IntelliJ IDEA
I can’t import that simple library, i have all jar files, also i tried Ivalidate Caches / Restart. Maybe i have to add validation to build path, but i don’t know to which file. Answer Got it. File -> Project Structure In Modules click Dependecies, then click green “+” on the right side Click JARs or directiories… and add JAR
IntelliJ IDEA: StackOverflowError on Build Project
I am using the following IntelliJ. I have been getting java.lang.StackOverflowError upon building the project. Has anyone fallen into the same situation? Build Message↓ Answer Adding -Xss4m to the build process VM options should help:
Gradle NoClassDefFoundError when running jar
I’m trying to set up a Gradle project with some Velocity functions in it. So far I have the following files: src/main/java/com/veltes/velotest.java: build.gradle: Now, when I run gradle assemble and gradle build everything is fine, but when I try to run the project (same for running the built jar in build/libs/ and for running the velotest class in IntelliJ), I