Java (not to be confused with JavaScript or JScript) is a general-purpose object-oriented programming language designed to be used in conjunction with the Java Virtual Machine (JVM). "Java platform" is the name for a computing system that has installed tools for developing and running Java programs. ...

learn more… | top users | synonyms (8) | java jobs

0
votes
0answers
2 views

CheckBox issues in JavaFX

I am working on an assignment and I am using check boxes to convert my text from normal to bold, italics or both. However when I run my code, I get some errors saying my checkbox has no constructor ...
0
votes
0answers
10 views

Json parsing shows “String cannot be converted to JSONObject android ”

The json parsing was working fine when i used the result of the MOVIE DB API as a input for the json parsing code . The problem started when i used ASYNC TASK to get the api result it showed this "...
0
votes
0answers
3 views

Java Play 2.5 Global Errors are not rendered in the template

I have a problem trying to get the global errors to be load at the template. I always got this screen. The default error page of play framework There is a way to be able to get the error to be ...
0
votes
0answers
6 views

How can i pass parameters in pageContext include

In my application I am trying to do a pageContext include in a custom tag java file. I am going to include a jsp file. Can I pass any parameters to the jsp file which would be scoped only to the ...
0
votes
0answers
6 views

Java applet gets hung on web page whereas works fine on the other web page

I am using a java applet in two web pages. In one of the web pages, it works fine whereas in the other web page, it just gets hung. In the 2nd webpage, I am passing two parameters to the applet (1st ...
0
votes
0answers
8 views

Spring Dependency Injection: Injection of all beans of type X as a Collection

I am wondering if it is possible for Spring's dependency injection framework to inject all beans of type X, like storing them all in a Collection. Suppose I have this class: public class Person { ...
0
votes
0answers
4 views

Sensors available in Cooja

After reading a lot about Cooja, Contiki and MSPSIM, I still have some questions. The "main" one I have in my mind is: where is the best place to find documentation about which sensors I can use in ...
1
vote
0answers
6 views

OpenCV Sorting Contours by Area in Java

This is my first time working with OpenCV, I am having trouble figuring out a method to sort the contours by area. I am looking for the two largest areas. Currently I have: List<MatOfPoint> ...
0
votes
0answers
7 views

Create auto increment field in spark SQL temporary table

I'm a new guy to spark environment.I use spark SQL to my project.I want to create auto increment field in spark SQL temporary table.I created UDF. but it didn't work properly.I tried various examples ...
0
votes
0answers
13 views

How can I check if a button is pressed from another class?

In my code, on one class, I'm trying to check if the button has been pressed on my other frame (class). If this is true, then some code will be carried out. However, I cannot find any code whatsoever ...
0
votes
0answers
18 views

creating JsonObject from JSONArray value in JAVA

I have a JsonArray Object like JsonArray[0]= { "streetName" : "xyz", "wardName" : "12xz"} JsonArray[1]= { "doorNumber" : "123", "plot" : "90z"} JsonArray[2]= { "...
0
votes
1answer
6 views

SNI Java 1.8 and Jboss SSL Handshake

My question(s): It would appear one of the differences in the underlying sun.net.www.protocol.https.HttpsClient is the HostNameVerifier implementation - The problem appears to be currently in ...
0
votes
0answers
14 views

Android : How to pass message a service to Recycle Adapter

I'm using the firebase messaging service for messaging and notifications. I can't seem to be able to pass an incoming message from the service to the adapter so that when the message is received it ...
0
votes
0answers
10 views

How to invalidate other session in java servlet [duplicate]

I have a usecase like below: User A is with user role and login successfully on application User B is with admin role and login successfully on application While User B manage and monitor the ...
0
votes
1answer
25 views

ClassNotFoundException for com.mysql.jdbc.ResultSet

My code is returning the above error, along with: br><br> Exception in thread "main" java.lang.NoClassDefFoundError: com/mysql/jdbc/ResultSet <br> <br> Caused by: java.lang....
0
votes
1answer
14 views

Getting “Exception in thread ”main“ java.lang.StackOverflowError” and a lot of errors

I'm really new to programming, and I'm working on a java assignment for school and I know That i got most of the code I've written wrong, but it's the first time I've really attempted anything like ...
1
vote
0answers
11 views

Java web-app running from tomcat spikes CPU to 100% and becomes useless

First of all thank you for reading this question. We have a Java webapp which gets hit 15req/s (tomcat access log) and around 60 to 80 users from Google analytics. This app does get very resource ...
1
vote
0answers
11 views

The filename, directory name, or volume label syntax is incorrect in Selenium Webdriver

I'm trying to read test data from a test file in order to test a login function. Here is my input file. Here, I'm seperating two input fields with a space. Here is my java class. package dataDriven;...
0
votes
0answers
8 views

Send an extra parameter in addition to formData in ajax to jave

I am trying to send an extra parameter with form-data in Ajax to Java. In Ajax, $.ajax({ url: 'example.com/test', type: 'POST', data: {formData, para: '...
1
vote
1answer
8 views

Jersey 2 resource needs to cleanup

I have a singleton resource that creates objects in its constructor, and when the application shuts down, and the server terminates, I need to release these objects. How is this done in Jersey 2? @...
1
vote
0answers
13 views

Having Issue With Enemy AI - Java

I am having an issue with enemy AI. The AI I am using right now is a dog. What the dog is supposed to do - The dog is supposed to follow the player if the player is within 200px of the dog. It's ...
1
vote
0answers
6 views

is there a way that I can run test classes of different maven sub_modules on a same jvm thread?

I have a maven project and it has several sub_modules, the directory structure like this: project pom.xml sub_module1 pom.xml src test1 sub_module2 ...
1
vote
0answers
12 views

broadcast message to all online users jsp ajax

I am trying to broadcast a message entered by an admin to be visible to online users as a pop up. i am using ajax to make a call to database with a time interval like the code below. This code runs ...
0
votes
1answer
22 views

Java (not so)Simple formatting

Hey guys so my homework was to: 1)Prompt the user to enter the number of cells C 2)Declare an integer array cell[] with C elements 3)Prompt the user to enter the number of time steps N 3)Prompt the ...
0
votes
2answers
20 views

How do i create different instances of a class using Enumerations as an identifier?

Hi im having problems with my game project because i require "extended" classes which have slightly different functions and creating an instance of Entity with just different names wont work properly ...
0
votes
0answers
32 views

Java lambda expressions exercise

Our teacher gave us an exercise about Java lambda expressions, we got code samples which are written in python and it has to be done in Java. Unfortunately i am not good in both python and lambda ...
1
vote
0answers
22 views

How to set schemaLocation for XML file generated using XMLBeans in Java?

I generated an XML file using XMLBeans in Java. The result is something like this: <ipdr:IPDRDoc IPDRRecorderInfo="192.168.95.82" xmlns:ipdr="uri://www.ipdr.org/namespaces/ipdr" xmlns:xsi="http:...
1
vote
0answers
9 views

Having a static nested class be a subtype of the enclosing class when trying to implement a Tree data type

I have been following along in the book Data Structures (Into Java) by Paul Hilfinger and I am having trouble implementing some part of a Tree structure. When during the implementation, the book ...
0
votes
2answers
21 views

How to properly instantiate a bi-dimensional array in Java

I am having problems on how to instantiate bi-dimensional array of objects. I tried to demonstrate below a small sample to reproduce the error I am getting. I have this class named Node that ...
0
votes
0answers
10 views

Cannot add a Rectangle to my JFrame

I have been trying to add a lot of Rectangles to my JFrame, but they are not appearing. I had it working before, but when I needed to add a label, I had to add the Frame Method, and now paint(); does ...
0
votes
0answers
13 views

Automating embed content in Internet Explorer using Selenium

Table I am trying to access I am trying to access a table on a webpage that lies in an embed tag. I'm unable to access (I need to check/uncheck the checkboxes) the table using Internet Explorer. The ...
0
votes
1answer
14 views

Action Listeners in Action Listeners Error

So, I have a JFrame by the name of rename inside of a JButton ActionListener. The following text below is JFrame rename = new JFrame("Rename File"); //other code JButton renameb = new JButton(); ...
0
votes
0answers
13 views

technology options for POS or Kiosk software (Java)

I want to write a software for POS/Kiosk and was looking at various alternatives (both web based and native) for developing the UI of the POS application. It will be a touch based application. ...
0
votes
0answers
7 views

okhttp unwanted escaping of form data

I'm trying to use okhttp to build a post request to send JSON to an existing service. but when ever i try to send the form okhttp escapes all the special characters in the JSON - but the server is ...
0
votes
2answers
21 views

This gives error after providing the size input. Please help I am new to Java

The below code is not working as after providing the size integer there is an error displayed Error Exception in thread "main" java.lang.NumberFormatException: For input string: "" at java.lang....
0
votes
0answers
15 views

Spring Controller methods getting called multiple times

Following is an example method inside my controller. The method is getting called thrice when its called. Same happens with all the methods inside my controller. @RequestMapping(value = "/pdf", ...
0
votes
1answer
8 views

How to create a simple Hadoop generator InputFormat

I'm trying to create an InputFormat that simply generates data without reading from an external location. It reads from the configuration for how much data to generate before closing. This is to help ...
0
votes
0answers
6 views

I've placed a CSV file in hdfs and formatted the namenode but when I try to list the hdfs' contents, I don't see the file

I have a CSV file named data.csv that I've placed in my /hdfs/namenode directory by scp'ing it from my local machine to the namenode which is an ec2 instance on AWS. I formatted the namenode using ...
0
votes
1answer
27 views

Class toString() method that returns a formatted array of objects

My situation is I have to make a toString() method for a class that basically just takes a bunch of objects from another class and puts all the objects into an arraylist. The class that makes the ...
-2
votes
2answers
50 views

Why is my getter returning null when the setter returns what its supposed to

My setter test value is the passed arguement. When I try to get it in the getter method, it returns null. I can not figure this out for the life of me. Here is my full code. I think it may be ...
-1
votes
2answers
26 views

Why use compareTo() from Comparable Interface when overriding the compareTo() method?

I have been googling around and the closest response (not answer) is here, but I am confused of the response. I am trying to sort some dog names using Collection.sort(), so I need to learn to use ...
0
votes
1answer
17 views

Java8 NIO Stream > More efficient way to recursively retrieve directory sizes?

For a given directory, I'm attempting to recursively retrieve each directory's size (in the most efficient way possible). I wanted to make use of the Java8 NIO Streams if possible (for speed & ...
0
votes
1answer
25 views

How to solve NullPointerException when running my ftc program

When we try to run the program in an android phone, the following message shows up: Robot Status: EMERGENCY STOP To attempt recovery, please restart the robot. Error: User code threw an ...
0
votes
0answers
7 views

Hadoop error when using balancer

I'm using Hbase on Hadoop HDFS, when I start hadoop balancer, it failed to move data from one datanode to anther. The error message in datanode is: 2016-11-18 10:08:55,916 ERROR org.apache.hadoop....
0
votes
0answers
4 views

How to change contents of .properties in Gradle upon war creation

I'm experimenting with Gradle's war plugin. At this point project is still using Ant. Its a standard webapp layout: | - project | ---- src/main/java | ---- src/main/resource | ---- src/main/webapp | -...
-1
votes
1answer
19 views

How to display user location on this android weather app

I got this code from a tutorial. I'm still learning how to code. When the code below runs, it displays the current temperature of the user location. I want to display the current location (city) as ...
-1
votes
2answers
33 views

NullPointerException when setting onClickListener in a Fragment

I am trying to create a DatePicker dialog that opens when a button in my dialog made from a custom layout is pressed. I have tried many different configurations of code and the result when the button ...
0
votes
1answer
12 views

Java: How do I draw my rectangle in my JFrame? [duplicate]

I am trying to draw a rectangle in my JFrame but when I run it it just comes up blank. I have tried a few other ways to draw it, but they all come up the same. Keep in mind I'm pretty new, so I'm ...
-2
votes
0answers
23 views

Should for loop variable increment by 1 in the beginning? [duplicate]

I've been using java for a while now but I am stuck on a problem that I just noticed. for(int i = 0; i < 5; i++) { System.out.println(i); } This gives an output of 0,1,2,3,4 ...
0
votes
0answers
18 views

How to generate constructor which populates member variables and calls super constructor

I am using ByteBuddy to generate a class which either extends a class or implements an interface. The generated class has 3 private final variables that I need to populate in the constructor. It is ...