Category "java"

Files.exists(path) is false but file.exists() is true

Why does this code return false? Path path = Paths.get("C:\\aaa\\bbb\\ccc"); Files.exists(path); // false!? Even when I convert to it from a File (which exis

RestTemplate get body with ResourceAccessException

I'm sending API and receiving status code 400 with body I need to parse When working with RestTemplate I failed to parse response: try { ResponseEntity<

Java Mongodb regex query

I have to run this query in Java db.Users.find({"name": /^ind/i}) My Java code is Document findQuery = new Document(); findQuery.append("name", Pattern.co

Cannot resolve symbol Theme.MaterialComponents.Light.NoActionBar (Android Studio)

I've got an error for 'Theme.MaterialComponents.Light.NoActionBar' in styles.xml (the 'Theme.MaterialComponents.Light.NoActionBar' is colored red because of err

Java Swing - Maskformatter digits from Right to Left

I would like to enter in a JFormattedTextfield with a Maskformatter digits for inserting time units (min:sec with mask ##:##) from Right to the Left. I used Set

Java: Telling whether a byte array is a zip file

I have a server written in Java, that in a single request, gets a whole file from the client. The file is passed to the server as a list of bytes, and is finall

Gradle removes directory defined as task output (stale directories)

I have an unzipData gradle task defined as following: task unzipFile(type: Copy) { dependsOn mkdirTrash dependsOn downloadFile from zipTree(file("$trash

How do I see if a specific CheckBox is selected within a GridPane?

I've created a 10x10 GridPane of CheckBoxes. I need to see whether a specific CheckBox is selected, but the GridPane is made up of nodes. So If I access a parti

stanford nlp api for java: how to get the name as full not in parts

the aim of my code is to submit a document (be it pdf or doc file) and get all the text in it. give the text to be analysed by stanford nlp. the code works just

PHP Java bridge exception - protocol error

I am running the PHP-Java bridge server (apache-tomcat). Sometimes I get an intermittent error. It's working when I restart the tomcat server from /opt/apache-t

How to solve Error: Invalid or corrupt jarfile

I have a Intellij Gradle project for HelloWorld. The program runs in the IDE but running the jar files with an invalid or corrupt jar error. I made several chan

Parameter 0 of constructor in 'Controller' required a bean of type 'service' that could not be found. Not working: adding annotations, componentscans

I'm trying to use Services and DTOs in my project (trying to learn what they are and how they should be used). First, I had only Controllers, Models and Reposit

Why mediaPlayer.stop(); is not working here?

[AS] I've loaded two sounds that can play and overlap with no problem, however I can't seem to stop or pause them. In its current state, the stop button only w

How to resolve a maven dependency with a name that is not compliant with the java 9 module system? [duplicate]

I am trying to build a demo project in java 9 with maven that uses the dependency: <dependency> <groupId>org.apache.spark<

Write a java program to read from a lengthy string (using streams) and write the output to a file?

How can I get a lengthy String as an input using streams and how to write the output to a file ?

Intellij Spring Initializr not available

I'm using Intellij IDE to code spring Boot. Spring Initializr was not available for me in the new project option as in. http://blog.jetbrains.com/idea/2015/03

how can i make BCryptPasswordEncoder() work in spring because in my application can't find that classes

how can i make BCryptPasswordEncoder() work in spring because in my application can't find that class about that and the message is not matching for dependenci

WARNING: Exception encountered during context initialization - cancelling refresh attempt

Error is as shown below. The problem is, occurring as below, this XmlWebApplicationContext need not occur, since it's injecting the bean again. How to avoid it?

"Graphics Device initialization failed for : d3d, sw" for JavaFX on IntelliJ IDEA Windows

While trying to run a simple JavaFX program on IntelliJ IDEA, I kept getting a long line of errors in the console that started with "Graphics Device initializat

Android Studio Error when Creating a Project with a Google Maps Activity

When I create a new project in Android Studio with a Google Maps Activity I get the following error when I do the initial build of the project: Manifest mer