Category "java"

Spark saveAsTextFile() results in Mkdirs failed to create for half of the directory

I am currently running a Java Spark Application in tomcat and receiving the following exception: Caused by: java.io.IOException: Mkdirs failed to create file:/

Google SignIn API Exception 10

Approaching to the final stage of the authentification, but something is going wrong in handleSignInResult method. It returns Exception code 10 (Developer error

Download .jar File From URL Using Java

I have integrated an update system into my Java program, and the one thing that is missing is a way to download a jar file from a URL using Java. How can one go

Display current time in 12 hour format with AM/PM

Currently the time displayed as 13:35 PM However I want to display as 12 hour format with AM/PM, i.e 1:35 PM instead of 13:35 PM The current code is as below

Socket communication between Android app and web browser

My Android device+app is continuously sending data every few ms, and I'd like to receive it on my web browser application that I'm building with JavaScript/HTML

HashMap with List of Objects as a Key

in HashMap when I pass List of Objects as Key I get different results. List<NewClass> list1 = new ArrayList<>(); List<NewClass> list2 = new Ar

is it possible to convert aar file to android studio project?

Currently I have an aar file and need to edit the structure and functions in it. I need to convert it to a project in order for you to edit it. Is there any way

get json array from servlet using ajax

I have to json array in my servlet. I want to fetch json array value and print in to jsp page using ajax. below is code JSONArray htags = new JSONArray();

How do I create an executable fat JAR with Gradle with implementation dependencies?

I've got a simple project in Gradle 4.6 and would like to make an executable JAR of it. I've tried shadow, gradle-fatjar-plugin, gradle-one-jar, spring-boot-gra

How can i add an image into an existing and specific pdf page (Itext)?

I'm developing a "program" that create barcode and insert them on the original pdf. This is my code: package com.mycompany.barcodeinserter; import com.itextpdf

StringBuilder .equals Java

class strb { static public void main(String...string) { StringBuilder s1 = new StringBuilder("Test"); StringBuilder s2 = new StringBu

Eclipse returns error message "Java was started but returned exit code = 1"

This is a picture of the error code Here is the content of the error message: Java was started but returned exit code=1 C:\WINDOWS\system32\javaw.exe -Dosgi.re

aspose email with java 11

I am trying to upgrade the aspose email version to 20.7 and I am using java 11 for my project, but I get these exceptions. The aspose email jar is in the classp

Get dual sim phone call logs (Call Log Is from what Sim Card)

We're creating a call log application and in a call log I want to show the user that the call log is from sim 1 or sim 2. I found this but when I try to get it,

Parse nested value from JSON and add into HashMap

I am using data from the Yummly API to get recipe details. I am creating an Android app which will display recipes based on a matching ingredient the user has e

Protocol violation exception in Java application

We have an application developed in java(jdk1.5 and DB is oracle 10g). At some point of time our application is giving below error and terminating. I had search

NullPointerException - find resource file

I have a maven project where i'm trying to read a javascript file but it can't find it and get a NullPointerException. This is a followup question on THIS POST

How to Update a flutter app on already published native android using java app in play console

I have published a native app with package name e.g (com.hamzamuazzam.foo) in Google Playstore and I want to update my app that is now made in flutter , also ha

Disable StartApp SDK auto show ads when activity is visibile

I was successfully able to add StartApp ads to my project, I only added 1 banner. My question is, why a full screen ad keeps showing when my activity is visibil

Having trouble creating overloaded constructor, instantiating an object

I'm new with Java and I'm having trouble going along with my teacher's video lectures (I'm taking an online class), and I'm having trouble with this assignment: