Category "java"

Creating a simple Hello world Android Client-Server program

To keep it simple, all I'm trying to do is to send a message from my Android Emulator to a Java console server on Eclipse that contains a simple string, then I

Removing Java 8 JDK from Mac

So I installed the beta of JDK 8 a while ago to look at some of the examples. I thought for sure by now, it's easy to change between versions. Doing some Play

Setting default values to null fields when mapping with Jackson

I am trying to map some JSON objects to Java objects with Jackson. Some of the fields in the JSON object are mandatory(which I can mark with @NotNull) and some

Connect Remote Database using Selenium Webdriver and run Test Cases from local machine through eclipse

I am using selenium web driver java built, the editor is eclipse. For testing one of our websites I am using Data-driven testing by fetching data from MySQL dat

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