Category "java"

Spring Boot @EnableScheduling conditionally

Is there a way to make @EnableScheduling conditional based on an application property? also is it possible to disable controllers based on properties too? What

Cucumber: Can't convert DataTable to List<java.lang.String>. There was a table cell converter but the table was too wide to use it

Feature file: Scenario: Login to application Given I open my application And I login with following credentials | admin | pass1234 | StepDefs: @When("^I lo

Android gives error "Cannot fit requested classes in a single dex file"

I don't know why but it's impossible to launch my app on my mobile this morning. I get this error message: Cannot fit requested classes in a single dex file. T

Cannot resolve method registerReceiver(android.content.BroadcastReceiver, android.content.IntentFilter) in Fragment class

//here my code //used this IntentFilter IntentFilter filter = new IntentFilter(); filter.addAction(BluetoothAdapter.ACTION_STATE_CHANGED); filter.addAction(Bl

Difference between String trim() and strip() methods in Java 11

Among other changes, JDK 11 introduces 6 new methods for java.lang.String class: repeat(int) - Repeats the String as many times as provided by the int paramete

Java application for sorting and selecting

I need to develop a simple application for sorting and selecting data according to predefined rules. The application must be able to work with JSON lists of obj

App isn't building after update Firebase Performance SDK

After update classpath 'com.android.tools.build:gradle:3.5.3' to classpath 'com.android.tools.build:gradle:3.6.1' Getting compile errors below.... Caused by: o

java.lang.UnsatisfiedLinkError: Could not load library gstreamer-0.10

I'm getting this issue while compiling the code below. I installed gstreamer for Windows and added development jar file to my IDE but I couldn't solve this prob

How to setup Javacc in windows 10 [closed]

How do I install javacc in Windows 10? I visited https://javacc.github.io/javacc/, but there's no clear instruction to set it up on Windows.

Apache camel route is not identified

I have a spring boot application to which I am adding a camel route. The class where the route is defined extends FatJarRouter and is annotated with @Component.

How to generate and preview a presigned url of a file in jsf?

I am trying to preview any type of file such as image,pdf,doc,odt,xlsx,csv,text etc in my web app using jsf. My flow of code: Generating a presigned url using a

PDFBox render image misses content

When using PDFBox, we encounter an issue where if we call render on a PDDocument, it sometimes loses content, such as fonts or certain shapes. Having dug into

Why does my for loop to disable buttons not work, but the same loop works for setting colors in JFrame?

I am programming a TicTacToe game and I want to use a for loop with my JButton components inside them like this: private void clearField(){ for (int i = 0;

How to run Docker with python and Java?

I need both java and python in my docker container to run some code. This is my dockerfile: It works perpectly if I don't add the FROM openjdk:slim #get pyth

How to format java.time.LocalDateTime and java.time.LocalDate with pattern?

In the following snipped the property $F is of class java.time.LocalDateTime or java.time.LocalDate. <textField pattern="EE. dd.MM.yyyy"> <reportE

In app update in android always give UpdateAvailability.UPDATE_NOT_AVAILABLE

I am using in-app update but it is not working in production. I tried various ways but could not resolve the issue. The code is in java for android studio proje

Are abstract classes faster than Interfaces in Java?

According to this article here, on abstract class vs interface, abstract classes a SLIGHTLY faster than interfaces, why is that and can you explain the mechanic

Unable to create a template

I am trying to create a dataflow template using the below mvn command And i have a json config file in the bucket where i need to read different config file for

How do I make my Android app prefix each displayed line of text with ">"?

My app displays a long line of text like this: I want to add a ">" character to each line, so I tried the following code: private String addPrefixChars(Stri

Determine a bounding rectangle around a diagonal line

A user will define a line on screen which will have, when drawn, a given thickness (or width). I now need to be able to determine the coordinates of a bounding