Category "java"

idea: too many module declarations found

I want to create hello world java 9 application and start it in intellij idea. Now I have following structure: content of inner module-info.java: module my.m

How do I use the same variable between buttons?

I've created a rock paper scissors game in java, but I don't know how I could use the same variable to work between 3 different buttons (rock, paper scissors).

Difference between method chaining and fluent interface

I wanted to know the exact difference between method chaining and fluent interface. As I understand it, method chaining is just running the methods of previous

Remove/revoke GitHub OAuth 'access_token'

I am using this GitHub's API to generate an access token for the user (mobile app), using this tutorial: https://developer.github.com/apps/building-oauth-apps/

context.getInitParameter("") and config.getInitParameter("") always returning null

I am a beginner in servlets and JSP and I've tried my best to get the values yet I am getting null, any help is welcomed: This is basic code on using ServletCon

Java string matching with wildcards

I have a pattern string with a wild card say X (E.g.: abc*). Also I have a set of strings which I have to match against the given pattern. E.g.: abf - false

How to assign an icon to a file?

I am making a program that stores information in a file with a custom extension. I was wondering If it is possible to assign it an icon within the program so th

Parsing encrypted PKCS#8 encoded pem file programatically

I am having trouble figuring out how to properly read a private key of a pem file. I have gone through different topics on stackoverflow, but I couldn't find th

The class 'javax.persistence.Convert' is required to be in the selected libraries

When selecting a user library as the JPA implementation in Eclipse Dali's project settings, the following error message is displayed: The class 'javax.persi

How to find file path to a bash file when the folder is renamed or moved to a new drive?

I've made an executable jar file for a terminal game that can be opened by typing java -jar name.jar in the Terminal. Then I made a .sh file inside the same fol

java.lang.NoSuchMethodError: javax.ws.rs.core.Application.getProperties()Ljava/util/Map;

I am unable to find answer through the following links One Two Three Following is my pom.xml dependency <dependencies> <dependency>

Why CompletableFuture.runAsync is not executed? [duplicate]

I consider that main thread must end after sub thread. However, below code shows the process finished before print the "async end". What is th

Android app crashes at start with "E/dex2oat: Failed to create oat file" and "non-0 exit status"

My app (still WIP) runs fine on different devices. But suddenly it refuses to start on Huawei Honor 7 (Android 6.0/EMUI 4.0.3). Logcat gives me the following:

java.io.IOException: grpc failed

When I use call getFromLocationName I get an IOException with description "grpc failed". Code that's ran @Override public void onMapReady(GoogleMap googleMap)

Java, get calling instance [duplicate]

Following example public class C{ A myA; public C(){ myA = new A(); } } public class A{ C myOrigin; public A(){

What are trustAnchors ? and How do I configure it?

I was recently assigned a java project. I am not very familiar with Java. I have been trying to build the projects but I am having the following error: the trus

Unable to create same parameter value twice in json array

In this code, I am trying to creating something like this- public String KLYA_JSON_LookUp_MultiNode(String KLYA_To,String KLYA_DLRURL,String KLYA_To2) {

How do you take an initial sample from a flux?

The sample operation takes the first entry from flux after the duration. How can I make it such that I take the first entry on subscribe and then do the rest?

How to verify icon's presence in statusBar of Android with Selenium?

I need to write code (Java, Selenium) that verifies icon's presence in Android status bar. For instance, after enabling airplane mode, a plane icon appears. But

How to output/serialize correct YearMonth value to display on form using Spring annotation?

I have the following variable in my POJO class being used to load the correct saved data into a form: @JsonDeserialize(using=YearMonthDeserializer.class) @JsonS