Category "java"

QueryDsl BooleanBuilder: How to create a predicate that compares another field?

I have simple example: to find all items that are sold out. Item has initialQuantity and soldQuantity integer fields. (for some reason I need initialQuantity

The class folder is not associated to any output library entry

My Eclipse plugin project which holds libraries used by other OSGi plugins gives me the following warning: The class folder 'lib/' is not associated to any

How to determine the file extension of a file from a uri

Assuming I am given a URI, and I want to find the file extension of the file that is returned, what do I have to do in Java. For example the file at http://www

How to create a standalone .exe in Java (that runs without an installer and a JRE)

How can I make a standalone Windows executable(.exe) for my JavaFX project(I wrote in IntelliJ IDEA), without an installer for my program? I want the user to do

Get array as result of ScriptEngine.eval()

I'm trying to use javax.script.ScriptEngine to eval() some JS scripts. How can I know if the result after eval() which is of type Object is an array? And if so,

Jsch java ssh client is not getting disconnected after command gets executed

I am using java ssh client (http://www.jcraft.com/jsch/) to connect to remote machine and execute the command. The code is working fine till i connect to remote

How to configure log4j in a Spring Mvc application configured with Java Annotations and using a log4j.properties file

I'm working on a Maven Web application using Spring MVC 4.2.5.RELEASE, I'm using Netbeans IDE with GlassFishSErver 4.1, I want to use log4j 1.2.17 so I created

Get path to all XML's nodes

I have an example XML as follows: <message> <metadata> <msg_id>1</msg_id> <client_type>type1</client_type> <

How do I clone a java byte array?

I have a byte array which i want to copy/clone to avoid calling code from modifying my internal representation. How do I clone a java byte array?

Composite Primary Key using MongoDB and Spring Data JPA

Could someone tell how to create a composite key in Spring Data JPA using Mongo DB

How to run a .jar in mac?

I've written a relatively simple java application. I have JDK on my PC, but I need it to run on a mac for school. The .jar runs perfectly on my PC, but I tested

How to list all embedded files from a microsoft office document, using Apache POI?

is there any opportunity to list all embedded objects (doc, ..., txt) in a office file (doc, docx, xls, xlsx, ppt, pptx, ...)? I am using Apache POI (Java) Li

How to do I locate a Google SpreadSheet ID?

https://developers.google.com/apps-script/guides/rest/api#parameter_and_return_types When using the Google Execution Api for Java, the ID of the spreadsheet is

How to create an ArrayList that is accessible by different classes in android? [duplicate]

I got a CameraView class (with an onPreviewFrame) which on each incoming frame calculates a value of 1 or 0 depends on the frame brightness, I

Can I use generics over reference types only?

While coding a Map<>, I found out that declaring Map<int, int> is a syntax error while Map<Integer, Integer> is OK. Is it only possible in Jav

Select random element from the list in Selenium Java and click on it, but getAttribute is not equal to zero

I'm trying to get random element from the list and click on it. The thing is, the elements are products which have attribute "quantity" and I want to click on t

CORS : Response to preflight request doesn't pass access control check: Redirect is not allowed for a preflight request [duplicate]

I am trying to integrate the angualar js app with the backend spring boot , in which i am facing the redirection is not allowed for a prefligh

Micronaut @Requires annotation not respected in pipeline

I have built a Micronaut application which so far has not had any CI pipeline. All builds work flawlessly on all developer computers, but I can't for the life o

What is the difference between a Hashtable and Properties?

What is the difference between a Hashtable and Properties?

Does java have something similar to C# properties? [duplicate]

C# properties (I mean get and set methods) are a very useful feature. Does java have something similar to C# properties too? I mean how we can