Category "java"

Illegal UTF8 string in constant pool in class file error in IntelliJ

Whenever I try to run a file (java main, cucumber feature, junit test) I get the following error in IntelliJ Idea: Information:15/05/2015 14:57 - Compilati

Creating a jar from a maven project in intellij

I created a new maven project in IntelliJ and set packaging to jar but when I build it, the target folder does not contain a jar. I'm sure its something really

How to increase IDE memory limit in IntelliJ IDEA on Mac?

I'm using IDEA 12 Leda on Mountain Lion. I wanted to increase the maximum memory that IDE can use. I set the VMOptions in Info.plist file to be -Xmx2048m -ea -X

Netbeans 12.6 and 13.0 SQL profiler no longer works for Java 8

I get this error stack when trying to SQL profile a Java 8 project which I don't get on 12.5 and below: Profiler Agent: Established connection with the tool Pro

Dynamic drop down list with AJAX and database

I'm hoping someone could guide me in the right direction. What I'm trying to do is create two drop down lists where the second one (cities) depends on the first

List<String> as input of GET method

I have a REST service. The input type of the GET method is List<String>: @GET @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) public L

Get Current Day (Monday, Tuesday, etc) in Java

I am working on a program that asks the user which day they would like to see a lunch menu for. They can enter any day by name (Monday, Tuesday, etc.). This wor

MongoSocketOpenException - trouble with connecting to MongoDB

This is my first time trying anything with MongoDB, so I would love any tips if you guys have any, but in particular, Im having trouble establishing a connectio

How to check if exists any duplicate in Java 8 Streams?

In java 8, what's the best way to check if a List contains any duplicate? My idea was something like: list.size() != list.stream().distinct().count() Is it

Kotlin + Java 9 modules (Java 11 in use) + maven

I've created a simple project with Java and Kotlin code, and I'm trying to compile it as Java 9 module. Here is my pom.xml: <?xml version="1.0" encoding="UT

For each loop using 2D array

This is the snippet of Java code: int[][] uu = new int[1][1]; uu[0][0] = 5; for(int[] u: uu){ System.out.println(u[0]); } It prints 5. But why does the d

Use Mockito 2.0.7 to mock lambda expressions

I want to mock a query provided on my repository like this: @Test public void GetByEmailSuccessful() { // setup mocks Mockito.when(this.personRepo.find

Tomcat does not start. Where was I wrong?

I did everything according to the instructions, installed all environment variables, but it still does not start. This is what is output in cmd when I try to st

Set PlaceHolder on JPasswordField

I am developing a system with Java (using NetBeans) and, to make it more "professional", I've added some cool functions, such as Placeholders (Yes, I know, it's

Writing A Recursive Function That Counts Zeros

It is possible to count the number of zeros in an integer through a recursive method that takes a single int parameter and returns the number of zeros the param

X-Ray and async multithreading: segment cannot be found

I need to run multiple async methods from the main thread, which should be able to finish even after the main thread has returned a response. I've added a metho

Checking and deleting attributes in SVG using Batik in Java

The question basically says it all. How can I check if SVG has a viewBox attribute? I am using Batik lib. I need this because I need to (at least) notify the us

NoClassDefFoundError when using KyroNet

When I try to use kyronet (for networking), I get this error. It seems like nothing is wrong in the code, and I exported it right. Here is the log: [TextRPG] S

Not able to set custom color in XSSFCell Apache POI

I am trying to set some custom(from hexcode or rgb value) color to a xssfcell.But the color of the cell is becoming black even though I am giving some other col

NoClassDefFoundError when using KyroNet

When I try to use kyronet (for networking), I get this error. It seems like nothing is wrong in the code, and I exported it right. Here is the log: [TextRPG] S