Category "java"

IntelliJ IDEA tells me "Error:java: Compilation failed: internal java compiler error idea"

When I compile a Java project using IntelliJ IDEA, it gives me the following output (and error): Information:Eclipse compiler 4.6.2 was used to compile java so

Passing a parameter versus returning it from function

As it might be clear from the title which approach should we prefer? Intention is to pass a few method parameters and get something as output. We can pass ano

Missing JUNIT Jar Exception while building project using Maven

I am in the beginning phase of Maven. I created a project and was trying to use the command. what is missing at my end? I am trying to compile and run a TestSui

how to add unsupported cipher suites(not included in the default cipher suites) to client hello message

the requirement is client shall support following cipher suites for TLS encryption: private String[] cipherSuites = new String[] { "TLS_DHE_

How to set headers in Soap Request Java

I am facing issue in forming a SOAP request. In that request i am supposed to add username , password and some other info in header part not the part of payloa

How to generate json data from Json Schema Programmatically in Java

I am trying to create Body-parameter(JSON) for my POST Api , which is a JSON request . All I have is the JSON Schema . I am trying to come up with a list of dif

How to resolve the Exception from WebTestClient?

How can I achieve the following with WebTestClient? @Autowired private MockMvc mvc; mvc.perform(req) .andExpect(status) .andReturn().getResolve

Find Element by Coordinates in Selenium (WebDriver)

I'm aware how to retrieve the coordinates of a web element in Selenium: WebElement element = driver.findElement(By.xpath(XPath)); Point location = element.getL

Mac OS X and multiple Java versions

How can I install an additional java on MacOS? I installed jdk8 and that works fine. But now I need a jdk7 installation for development purposes. When trying t

Minimum car required to accommodate given people

I had one coding round where question statement was like this *You have a given number of friends and seating capacity of their cars now you need to find minimu

JUnit5 - How to get test result in AfterTestExecutionCallback

I write JUnit5 Extension. But I cannot find way how to obtain test result. Extension looks like this: import org.junit.jupiter.api.extension.AfterTestExecutio

How to check whether a given string is valid JSON in Java

How do I validate a JSON string in Java? Or could I parse it using regular expressions?

SSL Java java.io.IOException: Invalid keystore format

I am testing SSL in java with SSLServerSocket and other classes in the java.ssl package. When I run the following code, I get the exception java.io.IOException:

How to get parent URL in Java?

In Objective-C I use -[NSURL URLByDeletingLastPathComponent] to get parent URL. What's the equivalent of this in Java?

JUnit5 - How to get test result in AfterTestExecutionCallback

I write JUnit5 Extension. But I cannot find way how to obtain test result. Extension looks like this: import org.junit.jupiter.api.extension.AfterTestExecutio

Exception in thread "main" java.time.DateTimeException: Invalid value for MonthOfYear (valid values 1 - 12): 0 when i am using Google Map jar

I am working on Geo Fencing So I am using Google Dependencies "android-maps-utils" and "geopackage-android-map" I installed these jar in my system and using t

Java Servlet: How can I retrieve selected radio button values?

I have created a simple servlet in which a user will be presented with 2 questions, answering either true or false. My problem lies in retrieving the answers se

Java - Azure Application Insights Dynamic Tracing not working with docker images

Azure Functions has dynamic tracing functionality for Java with App Insights. Where it collects metrics against several libraries. Full list here. As per this,

Mocking java.lang.reflect.Method using Mockito

I need to mock java.lang.reflect.Method for my test (I have dynamic things). We have written all the test cases using Junit spring & mockito. But I am facin

How to Change programmatically Edittext Cursor Color in android?

In android we can change the cursor color via: android:textCursorDrawable="@drawable/black_color_cursor". How can we do this dynamically? In my case I have