Category "java"

MapFragment becomes slow after navigating back to it from a preferencesFragment

I added a Preferences Fragment to an application. I am using an ActionBar drop-down menu to navigate to the Preferences Fragment and also using the ActionBar's

macOS - How to install Java 17

Could someone please let me know the steps to install Java on a Mac. I did brew install java I get this Warning: openjdk 17.0.1 is already installed and up-to-d

persistence jsonb field to h2 using hibernate

source code I want to use jsonb column type. When I used postgresql there is no problem. But when I use H2 I can not persist my entity. Native sql works but whe

When Grabbing a File through JFileChooser why does this fail?

I'm trying to understand Java Swing GUIs. So I created a simple GUI to select a File. When I attempt to use the FFMPEG wrapper to get file information I get the

How to set a variable for Controller from HttpInterceptor? [closed]

I am building a Spring Boot application. I like to set a variable for the Spring Boot application. This variable should be set in an HTTP inte

Getting exception when code runs but no when code is being debugged on DJL

I am using DJL as a wrapper library for Numpy in Java to perform complex operations on matrices and I am having issues while trying to perform an NDArray#any()

How to get an object of current user in Spring Boot+JPA

I need to create shopping cart. I have a model CartItem: @Entity @Table(name = "cart_items") public class CartItem { @Id @GeneratedValue(strategy = Generation

Time complexity of path finding problem using dynamic programming

You are given x, y coordinates in the first quarter, and you try to reach the origin point (0,0) for example if you are at point (1,1) you can go to point 1,0

getUUIDS returns null when device isn't paired

For some strange reason i can't get the uuids of a device i'm getting after a discovery. But if I paire both device before the discovery, then the method getUUI

Play Core in app update giving UPDATE_NOT_AVAILABLE on production release

I have integrated the play core in-app update it's working fine in the testing track but when a release is published in the production track it's always giving

Find Indices of the pair of elements in the Array such that they add up to the Target value

I want to find a target sum in an array by adding integers until it's reached, then return the indexes which add up to the target by using streams. For example,

Is there a better way of writing native SQL query with EntityManager Java Spring Boot application?

My current code look like this. I am not using any ORM framework like Hibernate. I need to use this raw SQL query. public List<String> getEndcodedKeyByLen

java socket InputStream hangs/blocks on both client and server

I am recently working on a tiny program aimed to close the browser remotely. The basic procedures are as follow: Server side: Create a SocketServer to listen to

different jdk versions returned when requesting system

i wanna understang why these three commands not always return the same jdk. In the third request, the jdk is not the same. 1- when i launch this command java -X

LinkedList Add Two Numbers: LeetCode

You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single

How do I separate items in an arraylist by character in Java?

I'm working on a game of Go Fish for a school assignment and I need to separate a group of 4 cards in order to keep score. Any help would be greatly appreciated

How to set the shape rendering attribute to crispEdges using Apache Batik SVG 1.8

I'm trying to get Apache Batik 1.8 to output shape-rendering="crispEdges" instead of the default shape-rendering="auto" in the root <svg /> node. I've s

Strict @MockBean in a Spring Boot Test

I am developing a Spring Boot application. For my regular service class unit tests, I am able to extend my test class with MockitoExtension, and the mocks are s

Is there a way I can break up into more than 2 classes

I am wondering how/if I could possibly break this up into multiple classes but keep the values across objects to pass between both. I am unable to get things wo

Static variable evaluates to null at json.put()

I have a class only to store variables as keys like: public class V { public static final String SHOW_OR_FOUND = "show_or_found"; public static final in