Category "java"

Styling and organizing nodes inside a scene

I want to do the following things: Organize my JavaFX code's nodes Increase the size of my combo boxes a little bit Change the scene background's color. My c

How do I generate a JaCoCo report for a JAR file?

We are trying to report code coverage of tests against a pre-packaged JAR file using JaCoCo. To do this we start the JAR file using java -jar with the additiona

How to sleep a thread in java for few milliseconds?

I would like to sleep a thread for 1ms. I used to implement the sleep in java code with Thread.sleep(x) being x the amout of milliseconds that I want to sleep.

Convert Int in Request Body to Long always

I wrote my backend in Java, and the endpoint is hit with a request body. The endpoint has a JSON body that looks like this {"id": 1234, "data": {...}} Now, I

The AsyncTask API is deprecated in Android 11. What are the alternatives?

Google is deprecating Android AsyncTask API in Android 11 and suggesting to use java.util.concurrent instead. you can check out the commit here * * @deprecate

Not able to create a new collection-type in Strapi Dashboard

I had just created a STRAPI project using , find docs here npx create-strapi-app@latest my-shop1 And then sign up to the admin portal. After signing up, I reac

Where can I find the database that I am trying to access with Hibernate?

I am browsing through a code that is not mine and I would like to manually change a few pieces of data within the database of the application. The code is using

Elasticsearch: Could not find or load main class org.elasticsearch.tools.launchers.JavaVersionChecker

I'm using CentOS and have downloaded Elasticsearch 6.2.1. I created a new user "elastic" and when I run ./bin/elasticsearch I get the error: Could not find or

find max of an input array

EDIT :: I was assuming there would be 3 array. The problem was not asking for that. I am trying to write a program from the platform Jutge.org that reads seque

Content type multipart/mixed not supported / 415 UNSUPPORTED_MEDIA_TYPE (after Spring + Spring Boot upgrade)

I was previously using the following versions of Spring + Spring Boot: <springVersion>5.0.16.RELEASE</springVersion> <springBootVersion>2.0.5.

Default implementation for hashCode() and equals() for record vs class in Java

Tried with sample code to check default behaviour of equals() and hashCode() for record vs class, but it seems behave differently for record compare to class. H

com.google.android.gms.common.SignInButton button not displaying in design using Firebase

Connected Firebase with my Android project and here is my build.gradle file code: apply plugin: 'com.android.application' android { compileSdkVersion 26

Generated Android espresso test fails to run, AndroidJUnitRunner failed to resolve: Landroidx/test/platform/io/FileTestStorage;

After recording a simple espresso test on my app the test fails to run and I'm hoping someone can guide me as to why this is happening. The resulting error is:

Load Spring Boot Classes in ClassLoader

I need to read a Spring Boot jar and load all the clases on a ClassLoader. My problem,in spring boot classes are on "/BOOT-INF/classes" directory and not on t

How to handle nullsFirst in this case

Incase the Field is empty , how can i sort the list based on Date ? import java.time.LocalDate; import java.time.format.DateTimeFormatter; import java.util.Arr

Why should I use an interface when there is only one implementation class?

I'm new at programming and I'm learning Java. I was just wondering why I should use an interface when there is only one implementation class?

Does Java have a similar post method diamond operator that C# has?

The Unity project makes frequent use of C# functions that supply a type in a diamond operator after the method name. In the Unity source code it's defined like

Parse postgres URL

I'm trying to parse postgres db credentials, the format is as follows: postgres://usernname:password@hostaddress:port/databasename I'm calling a method which r

How is the gdal.Translate function used in the GDAL Java bindings?

I am trying to preform some processing (i.e. applying a function to the contents of each cell of a raster, and then writing that out as a new raster), where the

Debugging java swing application in eclipse

I have a large application made in java swing. Its a children drawing app. I need to put some restrictions, for example, if they draw a rectangle, then they can