Category "java"

Error resolving version for plugin 'org.codehaus.mojo:maven-war-plugin' from the repositories

I am using eclipse Indigo Service Release 2 with JBoss tools installed and created a Seam Web project with Maven integration selected. After the project is crea

building a bottomUp heap

im trying to do a heap bottom up construction from Psuedo code from my text book however the output im getting is not a correct heap im getting out 2 9 8 6 5 7

Running in Eclipse is Not Able to Find the Class

Trying to run my project in Eclipse, but it creates the following error: Apr 11, 2014 8:02:17 AM net.minecraft.launchwrapper.LogWrapper log INFO: Loading tweak

Bazel build on cycle in dependency graph error

I am doing a bazel build for my project,i created a java_library rule and used at different places. but I am having this cycle in dependency graph: ERROR:

Spring boot - @Service class calling another @Service class

Is it fine to have a @Service annotated class calling another @Service annotated class? Or it is a bad practice? Eg.: @Service public class MyService { //

HTTP Status 500 - Path friends does not start with a "/" character

Below is the error: HTTP Status 500 - Path friends does not start with a "/" character type Exception report message Path friends does not start with a "/" ch

Scanning multiple lines using single scanner object

I a newbie to java so please don't rate down if this sounds absolute dumb to you ok how do I enter this using a single scanner object 5 hello how do y

To check if a number is Armstrong number using java

this is my program: public class ArmstrongNumber { public static void main(String args[]) { int n = 0, temp = 0, r = 0, s = 0; Scanner in

How to set JAVA_HOME environment variable on Mac OS X 10.9?

I just purchased a brand new MacBook Pro. This is my first MAC ever and I'm still trying to get the hang of navigating my way around. Anyway, I'm also new t

How to do this string pattern aaabbc to be displayed as 3a2b1c in java 8 using streams

I want to display the String pattern aaabbcc to be displayed as 3a2b2c in java8 using streams I have a working example in lower versions String str = "aabbcccdd

Compiling multiple packages

I'm building a small Java project and must compile it from the command line and can't figure out how. The packages of the project are the following : Project +

How to run TestNG test several times with BeforeTest execution?

I try to execute the test several times with DataProvider. All works fine, but @BeforeTest and @AfterTest execute only one time, but I need this execution with

HttpPost: InputDispatcher: "Channel is unrecoverably broken and will be disposed!" on Nexus 7

On Nexus 7 (4.3), and not on my older device, LG Optimus 3d (Android 2.2), when I do HttpPost, I get this E/InputDispatcher﹕ channel '4273f7b0 ... Main

Would it be the right approach to close and open a new WebDriver session between negative tests in Selenium?

I close my driver and reopen it between each negative test, for example - in my negative login test - if the test failed it means the login succeeded, then I cl

How to run TestNG test several times with BeforeTest execution?

I try to execute the test several times with DataProvider. All works fine, but @BeforeTest and @AfterTest execute only one time, but I need this execution with

The FileReader cannot find my text file

I have a simple text file and for some reason, it cannot be found. I don't see anything wrong with the code because I got it from a site, and I am starting to t

How do I view source code of built-in classes in Java (e.g. BigInteger etc.)? [duplicate]

For example, during some compilation errors, I get access to some built in source codes where the error has occured (maybe the perimeters were

Java "VariableDeclaratorId expected after this token"

I'm working on a little project for fun, that's essentially a little combat emulator. I'm trying to use a class similar to struct in C++, as in using it to crea

spark elasticsearch: Multiple ES-Hadoop versions detected in the classpath

I'm new to spark. I'm trying to run a spark job that loads data to elasticsearch. I've built a fat jar from my code and used it during spark-submit. spark-subm

Counting unique characters in a String given by the user

I have to write a program that counts the uniques characters in a String given by the user. For example "abc" returns 3 and "aabbccd" returns 4. I am not allow