Category "java"

How can I change Mac OS's default Java VM returned from /usr/libexec/java_home

(Wasn't sure if this should go on SU... migration is certainly an option, but more programmers read questions here, so here goes). I am running Mac OS X 10.8.4

i want to test java multithread ,but only one thread run

public class ThreadText { public static void main(String[] args) { windows w=new windows(); Thread t1=new Thread(w); Thread t2=n

How to read a properties files and use the values in project Gradle script?

I am working on a Gradle script where I need to read the local.properties file and use the values in the properties file in build.gradle. I am doing it in the b

onTouchListener ACTION_MOVE not working with more than 1 finger

I'm building an OpenGL ES app and I use an onTouchListener to detect touch events, as suggested by the android development website (https://developer.android.co

401: Unauthorized Exception occurred with an apache axis client(java) to invoke a webservice(.net) with an NTLM Authentication Technique

I am calling a web service written in .net located remotely running under IIS Server. I created its respective stub using apache axis 1.4 with eclipse IDE an

Mockito.when().thenReturn() doesn't work or returns null

During the test there is a NullPointerException thrown. I tried to debug it and the only thing I worked out was that eventOptional is always null. Just as if Mo

Java azure function not deploying dependencies

My app has a few maven dependencies. I am able to run the app locally as expected. When deployed via mvn clean package followed by mvn azure-functions:deploy, i

clone an existing project in gitLab

First, I was working on a spring project in STS, I created a project in GitLab and commit it to GitLab. Now, I messed up, I deleted the project that existed loc

JPA Repository.findById() returns null but the value is exist on db

I'm developing Spring boot project, using JPA. What I wanna know is repository.findById(id) method returns null, whereas data is available in the DB. Functions

How to use OR condition with TestNG assertions

Is there a way to do assertions with OR with TestNG? This is what I am trying to find: assertEquals(expected, value1 || value2); // Can be any number of valu

How to disable SSL verification for Elasticsearch RestClient v6.7.0 in Java

I'm trying to connect to an elasticsearch instance which is behind a ssh tunnel. Domain of the elasticsearch instance is *.ap-south-1.es.amazonaws.com while loc

Could not read standard output of command 'cmd'

I am getting the below error when I try to execute the 'clean package' maven command. Any ideas why the stream is closed ? However, when I launch the task by it

Reading lines with BufferedReader and checking for end of file

If I have something like this in my code: String line = r.readLine(); //Where r is a bufferedReader How can I avoid a crash if the next line is the end of t

How can I get my data from csv file to DataProvider

I need to take data(username and password) from my csv.file and use it to register some new Users using DataProvider in Selenium. I have made already Reader to

IllegalArgumentException: width and height must be > 0 while loading Bitmap from View

I'm trying to draw on an ImageViewTouch, a library which enables pinch zooming. I'm able to draw over the image using Canvas, but when I zoom the image, the dra

How to set default current date in jpa for mysql

I am trying to generate current date automatically but getting this error You have an error in your SQL syntax; check the manual that corresponds to your MySQL

Selenium DOM is not changed after execution of Angular ng-if condition

we have following code on page which has angular ng-if condition. <p ng-if="!old_email" style="line-height: 20px; font-weight: normal;"><b>Hi,</

Velocity template cannot be found in Windows 10

My laptop just got upgraded to windows 10 from windows 7, and a piece of code stopped working. A large application using velocity templates which used to work o

Getting Amazon Cognito Access Token in Java

We've been writing some code to test our endpoints and the authentication process. We use Cognito for authentication, our endpoints require an access token with

Unable to tunnel through proxy. Proxy returns "HTTP/1.1 407 Proxy Authorization Required"

I was trying to hit the https url for google api. Using the code below but its giving some errors. but i can hitting one google api http url and its working ve