Category "java"

How to limit number of parallel executions in ParallelStream?

list.parallelStream().forEach(element -> ...); How can I limit the number of parallel threads nowadays? There was a "hack" in the past to set a System prope

How to use math.max in thymeleaf to find maximum number?

While trying to use max function in thymeleaf I got OGNL expressionn everytime. I'm not even sure if we can use functions like max/min in thymeleaf. Tried to lo

evoking gradlew task produces never ending "....... Daemon, 1 busy Daemon could not be reused..." and add 1 to busy every line

Sorry if the question title is not quality to say the least, But i am stumped at this point. Trying to update any project i have to gradle-wrapper 6.5 and up p

can I pass java vm args i.e. -xms and -xmx through a property file to my java program

Can anybody help me in following problem: if I am specifying java args while running my program through java command then if I check my java process using ps -e

How to count groups string input with same character

this code is about Too Many Tabs code. URLs are considered equal if the domains are exactly the same, e.g. google.com and google.co.id are different Example inp

What's the resizable stack of JVM virtual threads?

The open jdk project "Loom" supports virtual thread which allows the classic IO-blocking API to enjoy the great benefits of async, reactor, coroutine developmen

Reasons for using a Bag in Java

I am currently studying about Algorithms & Data Structures and while I was reading over the Book of Algorithms 4th edition, I discovered the Bag data-struct

JDK 11.0.2 compilation fails with javac NPE on anonymous parameterized class type inference

Code (spring-web 5.1.2) public static void main(String[] args) { RestTemplate restTemplate = new RestTemplate(); HttpHeaders headers = new HttpHeaders

Apache Camel: MethodNotFoundException, Failed to invoke method on null due to: MethodNotFoundException

I try following a video tutorial for Apache Camel education and trying aggregate queue objects in a next way: @Component public class AggregationRoute extends R

AspectJ - Aspect from external JAR

I've added a github repo that show exactly my problem: https://github.com/runefist/AspectJ-Stackoverflow-Q In short, I have a project we'll call it ProjectA.

How to create a Paragraph with iTextPDF?

I have this mobile app where I need to export some rows of the database to pdf. I need to have a pdf structure in order to get the information correctly placed.

JSONObject always returns "empty": false

There is a Spring Rest Controller : @RestController @RequestMapping("secanalytique") public class SectionAnalytiqueController { @GetMapping(value = "/sect

Spotbugs build issue

Built failed while creating aws-sdk-v2 jars due to spotbugs plugin. Steps to reproduce the error: clone latest version of aws-sdk-java-v2 In terminal, go to dir

java.lang.ClassNotFoundException: com.mysql.jdbc.Driver even after using the mySql Maven Dependency on Intellij

I am using Intellij for a servlet project and using maven <dependency> <groupId>mysql</groupId> <artifactId>mysql-conn

Eclipse 'Project Explorer View' doesn't show Errors - Stack Overflow

In the "Project Explorer" view of a maven project, instead of showing errors (compilation) in the project itself (red blade), they appear at the level of the fo

java.lang.ClassNotFoundException: com.mysql.jdbc.Driver even after using the mySql Maven Dependency on Intellij

I am using Intellij for a servlet project and using maven <dependency> <groupId>mysql</groupId> <artifactId>mysql-conn

How to write List<Number> with OpenCSV?

I have the following field inside a StacItem Object: @JsonProperty private List<Number> bbox = null; I made a basic implementation with OpenCSV to write

How to make multiple Scanners with the same input line?

I'm making a terminal game that uses Scanner objects. Up to now, I've had no problems with the way I did things. But now, I want to add "cheat-codes", for that

Java TESSERACT create byte[] instead of pdf file - tessInstance.createDocuments()

Is it possible to generate with Tess4j the byte[] of a PDF with OCR instead of a physical file? I need to make PDF files searchable via OCR, it works but I woul

Discrepancy in Squaring a number stored in double format

I am trying to square a number x but there seems to be some discrepancy in precision while squaring it using Math.pow() and squaring it using multiplication. pu