Category "java"

Inputstream.available() always returns 0

I got some stupid problem, I don't know what am i doing wrong. I wrote client and server, client is working properly. I checked that output stream works prope

How to solve two dimensional growth grid problem?

I was doing an assessment for job interview. One of the 3 problems that I had to solve in an hour was finding the maximal value in a grid where you traverse it

Joda Time DateTimeZone

I was going through TimeZone page at joda website and I came across this -05:00 EST -05:00 EST5EDT -05:00 Etc/GMT+5 I just wanted to know what does

How a static method call works in Java?

When calling out the function testFunc(), I am not using the syntax Apples.testFunc(). Yet the code runs successfully. How so? class Apples { publ

JLable not showing up

public OpenFrame() { openFrame = new JFrame(); loadButton.setBounds(150, 100, 150, 100); loadButton.addActionListener(this); loadButton.setTex

Authorization Header not getting displayed in CURL springdoc-openapi-ui

I am using the springdoc-openapi-ui. I have configured the global headers named Authorization. When I execute the API Authorization is not showing in the CURL o

How to prevent touches prematurely stopping smoothScroll in RecyclerView?

I am using an Adapter to fill a RecyclerView with numerous CardView layouts (horizontally). Each CardView has a Button at the bottom of the layout, which when p

Automatically delegating all methods of a java class

Say I have a class with many of public methods: public class MyClass { public void method1() {} public void method2() {} (...) public void met

Could not find or load main class org.testng.remote.RemoteTestNG - in Eclipse

I've tried to update Selenium webdriver version and now i cant run my tests because of following exception: Error: Could not find or load main class org.t

error: package javafx.scene.media does not exist

I'm trying to create javafx media player as gradle project, but got this error.error: package javafx.scene.media does not exist on line: import javafx.scene.med

Install Protocol Buffers on Windows

I am unable to find clear instructions to install Google Protocol Buffers (including compiler) on Windows x64 platform. I went through the instructions README

My tests were running and then I clicked "Run as --> Maven clean" and now when I click "Run as --> Maven test" it doesn't work anymore

My project worked after right-clicking on the pom.xml file in Eclipse and selecting: "Run as --> Maven install" and then "Run as --> Maven test". I start

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