Skip to content

Tag: java

Cannot read the array length because “” is null

I have an exercise in java whose text is: The Matrix class represents an array of integers. Its skeleton is as follows: public class Matrix { private int [] [] mat; / * creates a Matrix object whose content is represented by the matrix matrix. * / public Matrix (int [] [] mat) {…} / * returns the sum of

Gitlab-ci docker inside java image

To use a integration test library https://www.testcontainers.org/” I need a image with java a docker installed at same time. I’m trying o use this stage: But It does not work: Any help? Answer The image gradle:jdk16 does not include the docker client. You’ll have to install it in your job. A…

format a json of a class in spring

I am new with spring and I want the json response of my class public class Mapping { public String name; public Object value; } be changed from {“name” : ‘value of field name’, “value”: ‘value of field value’} to {‘value of field name’ : ‘value…

How to know the path of a native library that JVM loaded?

Assume a Java source code uses System.loadLibrary(“lib-name”) to load a library lib-name. Further, assume that multiple copies of lib-name exist throughout the system. Question: is there a way to know the path of the lib-name that the jvm loaded? I’m looking for something like -verbose:class…