How do I configure the GRADLE_USER_HOME option? My Windows username contains a space(C:UsersBaz Foo) and I think that the build fails because of this. I have added an environment variable GRADLE_USER_HOME and set it to C:UsersBaz Foo.gradle and tried also with –gradle-user-home=”C:UsersBaz Foo.gra…
Tag: java
Exception in thread “main” java.lang.ArrayIndexOutOfBoundsException: 1000000 at problem2.main(problem2.java:17)
I get the following error and I don’t know why. I tried looking it up, but I didn’t find a solution. Exception in thread “main” java.lang.ArrayIndexOutOfBoundsException: 1000000 at problem2.main(problem2.java:17) Here is my code: Answer The problem is not the size of the int[]. Your wh…
Difference between Static methods and Instance methods
I was just reading over the text given to me in my textbook and I’m not really sure I understand what it is saying. It’s basically telling me that static methods or class methods include the “modifier” keyword static. But I don’t really know what that means? Could someone please …
What’s the most efficient algorithm to calculate the LCM of a range of numbers?
I looked around and found other questions that had answers but none of them address the scope of this particular question., including this question, and also this one. I have to compute the LCM of large ranges of numbers in an efficient way. I didn’t look too in-depth at those other questions because th…
Getting raw XML response from Java web service client
I am trying to get the raw XML response from a web service, instead of the usual set of POJOs. I am using a webservice client that I generated (so I have access to the client’s code) from a WSDL and some schemas. The client is generated in RAD 7.5, I think using JAX-WS. I’ve been looking at the cl…
How to deal with missing src/test/java source folder in Android/Maven project?
I’m not very experienced with Maven in combination with Android yet, so I followed these instructions to make a new Android project. When the project has been created, I get the following error message: Project ‘xxx-1.0-SNAPSHOT’ is missing required source folder: ‘src/test/java’…
Using JSch, is there a way to tell if a remote file exists without doing an ls?
Using JSch, is there a way to tell if a remote file exists without doing an ls and looping through the files to find a name match? Thanks Answer (This is if you’re using the SFTP part of the library, an assumption I made without thinking about it.) I thought its ls(String path) would accept filenames; I…
keep only function names when obfuscation for proguard
I use proguard for obfuscation. How can I keep only function names while obfuscation. class names must be obfuscated but function names. if I use, and it keeps function of somefunction, but it doesnt change classes names. But, I want to change classes names but somefunction Answer You can use -keepclassmember…
How to calculate the median of an array?
I’m trying to calculate the total, mean and median of an array thats populated by input received by a textfield. I’ve managed to work out the total and the mean, I just can’t get the median to work. I think the array needs to be sorted before I can do this, but I’m not sure how to do t…
Could not autowire field in spring. why?
I keep getting this error, and can’t figure out why.. yes I know there many people had similar issues, but reading the answers they got, does not solve my problem. org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘contactController’: Injection of autowir…