Category "java"

Gradle - "Changes are not tracked, unable determine incremental changes."

When running my LibGDX desktop project I sometimes get this error: Changes are not tracked, unable determine incremental changes. I've tried using Java 8 and 17

A way to consider the backslash as a normal character

Is there someone who knows how to consider the backslash as a normal character (not an escape character) in a string in Java? Any help will be appreciated!

How to set default download directory in selenium Chrome Capabilities?

Please find the below code with the chrome capabilities. In fact the browser is not downloading the file to the specified path. private static DesiredCapabili

AWS rds - How to read from a read replica inside of a Java application?

I am new to aws. I have a mysql rds instance and I just created 2 read replicas. My application is written in Java, and what I have done up until now is using

Converting String date to SQL Date

I have a string date in the format DD/MM/YY (16/07/13) How do I convert this string date to SQL Date format (maintaining the same DD/MM/YY format) for storing i

Restart Tomcat Service on AWS EC2 instance, on a schedule

I have an instance on Tomcat running on EC2. Based on some resourcing reasons that I don't want to get into, I'd like it to restart each evening at 11:00pm. I

Cannot Add Http Headers to Message with Spring's WebServiceTemplate

I have a fairly simple case where I am trying to add HTTP headers (not SOAP headers) to a request I am making using Spring's WebServiceTemplate. I have defined

how to get next item in ArrayList in java

i followed a YouTube tutorial about programming a quiz app using java android studio in the tutorial you put the question in array list then you get randomly qu

File has been compiled by a more recent version of the Java Runtime error SceneBuilder

I've used JLink + JPackage to build a JavaFX app into a self-contained application. I'm using JDK 14. However, when I try to open one of my FXML files in Intell

JPA created too many fields in table

enter image description here I am trying to map some entities to tables in MySQL database using Spring Boot JPA. I have a problem with one of the tables because

JDBC driver connection problems (sun.jdbc.odbc.JdbcOdbcDriver)

I'm having some issues with the connection with Java and SQL 2008 Express. I'm using sun.jdbc.odbc.JdbcOdbcDriver driver for the connections and have created my

Test a method that use a spring service

I have a problem testing a method in Java (I use jUnit 4) and this method to test make a call to a repository and should throw an exception if something is wron

React Native Android run causes "Illegal number of arguments for updateHotspot command"

I am creating a simple app using React Native for both iOS and Android. I've tested both platforms for a while and all works very well. But recently, I was focu

Why my RecyclerView updated while I don't notify the adapter?

I have some trouble to understand why my recyclerView get update while I add the data only after setAdapter() and never call notifyDataSetChanged() ! In the sa

Do variables/flags can be affected by another thread on a non-synchronized method?

For example I have a non-synchronized method like this: public void nonSynchronized(){ boolean flag = false; if(/*some condition*/){ flag

java.lang.ClassCastException class xxxxx cannot be cast to class io.micronaut.data.model.Page Micronaut data

Trying to implement the pagination with Micronaut data with MongoDB as below @MongoRepository public interface IDiscountRepository extends ReactorCrudRepository

How to enable assertions in the Gradle run task

By default, Java disables assertions. (The test I'm using here is assert false; as the first line in main().) I'd like to have them enabled while running my p

Error java.lang.AssertionError: expected: null<null> but was: java.lang.String<null> what does it mean?

I have this strange issue in my Junit 4.12 test code. The application uses Spring Framework 4.1.6 and Hibernate 4. When comparing two beans coming from differen

Mockito when() method not working and getting null pointer exception

I am writing unit test cases using Mockito and JUnit . But getting NullPointerException when running a test. On debugging I get to know that Mockito on method:

how to make overlay window view clickable and touchable in android

I am trying to learn how to create an overlay window similar to Facebook chat head messenger icon in Android. I managed to create the following class which ena