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
3 views

Efficiently compute the hashCode for a BitSet-like implementation of Set<Integer>

I wonder, how to efficiently compute the hashCode for a BitSet-like implementation of Set<Integer>.The BitSet#hashCode is obviously fast to compute, rather stupid(*) and incompatible with Set#...
-1
votes
0answers
12 views

Best way to compare ArrayList of Objects in Java

I have say for example a User POJO that contains name, age, type. If I have records of:[{"name":"mm", "age":20, "type":"student"},{"name":"mm", "age":20, "type":"student"},{"name":"mm", "age":...
-1
votes
0answers
12 views

how to convert an specific value from an object list to an long list using java lambda expression

i have an object list called "myDto" and it has Long type values called "ID" s. I need to separate only the ID values and save to another Long list. are there any way to do that using java 8 lambda ...
-1
votes
0answers
7 views

why is my java program not returning anything?

For some reason, I don't get an output with the main method when I try to run the convolution2d program. What am I doing wrong here?The program is supposed to look at the convolution 2d method in ...
-1
votes
0answers
8 views

java arraylist : saving into database

I have a registration form. User select their industries .I store it in a array list. User can add/ remove industries. They select 10-20 industry choices.How do we save such dynamic data in a db? ...
0
votes
0answers
3 views

/s/S in ANTLR parser rules

I want to write a parser rule to parse a valid String, my rule goes like this:STRING: '"' [\s\S]+ '"';But it gives me a warning saying invalid escape sequence \s. I tried other escape sequence ...
-1
votes
0answers
12 views

How to get all keys with same value in hashmap Java? [duplicate]

I have stored values in a hashmap :Key Value"act" "atc""tac" "atc""dog" "dgo""atc" "atc"I want to print all the keys orderly with the same values. I am not sure how to get all the keys ...
-4
votes
0answers
19 views

Need help for Android project very very new to java

I need help I am a student and I am doing a project on a queue cutting and epayment I have very very limited amount of knowledge on java and my project is due in 1 month time please help
0
votes
0answers
11 views

stopped app when I run It in the emulator

The code:package com.ayoubdesigner.sinbad.myapplication;import android.support.v7.app.AppCompatActivity;import android.os.Bundle;public class MainActivity extends AppCompatActivity {@...
-2
votes
0answers
11 views

Java Comparator.comparing() with String charAt() Function [duplicate]

I am learning the new Comparator.comparing() function.Here is the code I write to get a comparator for String to sort by the last char. To make the discussion simpler, here we just assume no null ...
-1
votes
1answer
6 views

What is causing java.lang.IllegalStateException: Ambiguous handler methods mapped for HTTP path

I'm getting the subject error message, however I can't figure out why. I have a fairly complex set of controllers. The subject controllers are as follows:package ws.daley.hollow.web.controller.admin;...
0
votes
1answer
14 views

Wanting to throw an intent to open a new activity but continually crashes

There's nothing fancy or complicated here. I am just looking to open a new, blank, activity from when I press on the textview. From the projects completed files, I seem to have done it as it wants me ...
0
votes
0answers
3 views

chrome Webdriver can't be resolved to a type error eclipse and java

Im trying to do some automation projects with chrome, java and selenium and having problems importing the chrome driver. package main;import org.openqa.selenium.*;public class SitePoster {...
0
votes
0answers
5 views

Merge Hot and Cold Observable with buffer

I have 2 sources of data. A service call which gets the current state of a list of itemsA stream of updates to these itemsI am trying to merge them in a way that I don't lose any of the updates ...
0
votes
0answers
10 views

Cant call another method from onClick Android - Throws illegalStateException

I am fairly new to Android, and am creating a simple contacts app. I have a 'Contact' class that holds first name, last name, etc, and in my activity I am attempting to read the input from the edit ...
0
votes
1answer
26 views

Purpose of using super constructor in derived class

I was taught that declaring the instance variables as protected is bad and it is considered bad design due to increased coupling between the super and sub classes. Instead, use a super constructor as ...
0
votes
0answers
8 views

How to refresh a web page by WebDriver when there is a 'Connection Timeout' on the browser or any other error while loading page?

I am using 'Java' and 'Selenium' to automate page checks using 'chrome'. My code runs well. However, the webpages sometimes are located in slow servers. There are times when they get '...
0
votes
0answers
8 views

Custom ArrayAdapter (Array list) saved on SharePreferences

I am trying to save a Array List in my program. The list contains Urls that the user has visited or loaded into the WebView. I have done some research and it is possible but out of the >50 posts I ...
0
votes
0answers
10 views

Spring @Transaction wrapped around lambdas?

In a method like this, will the transaction be applied to all of the orderLineRespository.insertOrderLine() calls inside the lambda?@Transactionalpublic OrderResponse ...
0
votes
0answers
6 views

java sign jar show java.security.AccessControlException: access denied (“java.lang.RuntimePermission” “accessClassInPackage.sun.security.mscapi”)

I am use sign jar applet to sign pdf but when sign it has error java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessClassInPackage.sun.security.mscapi")...
0
votes
0answers
9 views

Exception in thread “main” java.lang.RuntimeException: Cannot find KieModule

I facing the error as per subject above. As per the example i found the internet the jar file been deployed suppose to be located at http://ip:8080/drools-wb/maven2wb/... but i can't access the jar. ...
-1
votes
0answers
10 views

Primitive data type Error when using Insert Into, HIVE

I have a query which creates a table with a map nested inside another map. On its own the query is successful, but when I try the insert into table function hive throws out the following errorFAILED:...
0
votes
0answers
11 views

How to dynamically render thymeleaf tag which is coming from back-end

Is there any way to render thymeleaf tag which is coming from back-end?For example I have json (textObj) shown below coming from back-end.{ "title" : "Page Title","text" : "blah blah blah blah &...
0
votes
0answers
9 views

JAXb Unexpected element Exception [duplicate]

i am new to JAXB, i'm trying to use it to convert XML to java object. however when i run the Unmashal i get following error:unexpected elements (uri:"", local"BLAH").i know the issue tho: the ...
0
votes
0answers
7 views

Hadoop put vs copyFromLocal [duplicate]

Still i am confused what is the difference between put and copyFromLocal. A lot forum and blog convey that both are same and nothing difference. May be you have some better idea and which stand point ...
0
votes
0answers
5 views

How to trigger a dbms_scheduler job from Java repo in Spring?

I have an Oracle DB Scheduler job that I'm able to run directly using command:EXEC dbms_scheduler.run_job('MY_SCHEDULER_JOB');Now I'm trying to invoke the same job from my Java SpringBoot service ...
0
votes
0answers
12 views

Loading Tensorflow model in Java

I'm trying to use my trained tensorflow model for object detection in Java.I exported the model (trained with Python) with this script export_inference_graph. This generated a frozen_inference_graph....
-2
votes
0answers
16 views

Add “Name already exists ” in an app project

i already did this with my email but I don't know how to do it for other text inputs, like Company Name, Address, Name etc. here is my Validation class:public class InputValidation {private ...
-1
votes
0answers
7 views

Configure downloading over 2GB file from web broswer limitation

I'm using Spring framework 4.2.2 and tried to test file uploading and downloading from website(including chrome, explorer).and I configured maxUploadSize -1(unlimitation) in multipartresolver in ...
0
votes
0answers
14 views

Update Android app with HttpClient to OKHttp3

I'm trying to upgrade some Java code to fit in with an android app.The code references the depreciated the Apache http module which Android no longer supports since Marshmellow.I need to complete a ...
-4
votes
0answers
16 views

Measure wifi signal strength using Android basic app [on hold]

I am looking for an android app which can show the exact distance between wifi sender and receiver. I have no idea how to start with it . Can anyone help me to find the right way ?
-1
votes
0answers
7 views

Maven findbugs missing JRE classes

I'm getting a weird message while building a maven project. It doesn't seem to ruin the findbug report, but looks rather annoying.[INFO] Fork Value is true [java] The following classes needed ...
0
votes
2answers
17 views

Strange exception when id of the bean is set empty in spring's bean.xml

Just for curiosity, I left the id of the bean inside bean.xml empty. I was expecting the exception something like "bean id is not defined" or "bean id can't be null"But actually, I got the below ...
-3
votes
1answer
19 views

JSON Format using org.json

I am converting XML message to JSON using org.json classes and it works fine however the converted JSON message has root and row elements and we are in requirement to remove the nodesXML to JSON ...
0
votes
0answers
4 views

Wicket - DataTables and SortableDataProvider, how to implement it?

I saw the wicket examples about datatables but I not understand clearly how to implement it, so I want some explanation about it.For each datatable you must implement your own data provider and ...
0
votes
0answers
5 views

How to discover just the coordinator/ingest nodes?

This seems to be a very basic question, but I can't get a good answer.I'm using java JEST http client and the best example I can see is the opiton:factory.setHttpClientConfig(new HttpClientConfig...
0
votes
0answers
27 views

Apparently recursive Java extends [duplicate]

I'm trying to understand some third-party Java code with a generic class declaration I don't understand, of the form:public class Foo<B extends Foo<B>>Can anyone tell me what this is ...
0
votes
0answers
7 views

How to handle game object updates with kryonet client

I working on a simple multiplayer game in java2d that handles 4 players at a time.Here is a code sample that receives data from the server.server.addListener(new Listener() {public void ...
0
votes
2answers
17 views

Is string message used inside System.out or Logger interned? [duplicate]

I have a webapp created using servlets where i have multiple log statements.Assume LOG is a static variable of logger class initialised with proper context and class details, e is an exception ...
0
votes
0answers
5 views

How to verify Microsoft Excel file identity and integrity using Apache POI

I have a Microsoft Excel workbook (.xlsx format) that I plan to place it on our company website for customers to download and use it for applying a particular service to the Company. I have password ...
-1
votes
2answers
39 views

Implementing a conditional for loop

Is there a way to do something like this in Java?for (int i=0; if (a) { i < x } else { i < y }; i++) { ... }Thanks in advance.
1
vote
0answers
18 views

One big EC2 or multiple small EC2 or one ECS - which is cost-effective?

We are running 6 Java Spring Boot based microservice projects in one AWS t2.large(2 CPU & 8GB RAM) EC2 machine. When we see the CPU and RAM utilization of this EC2 machine, CPU is underutilized, ...
0
votes
0answers
5 views

pkcs11-tool generated keys in java are not getting loaded into pkcs11 keystore

I am seeing an null pointer exception when trying to get the private key from java pkcs11 keystore, when the key is generated by pkcs11-tool. This works fine if the key is generate using keytool. I ...
-2
votes
1answer
38 views

(JAVA) array into multi-line string

Having quite a lot of trouble with returning an array as a multi line string.let's say we have this: Town arrayTown[]=new Town[Constants.MAX_TOWNS];assume we add values to arrayTown.public ...
0
votes
1answer
12 views

How can I use fileReader to read text file data in Android Studios?

I have a fileReader that works in Java but the same method doesn't work for Android Studios. The code I use in Eclipse to read my text file data is:public void addTextFilesToCardsArrayList(String ...
0
votes
2answers
22 views

Error Developing a Class to Work With Tester

I was provided a tester (of which the code I cannot change) and I need to develop a class that works with this tester. I am having a hard time with my class. It seems as if I am getting an error "...
-1
votes
0answers
10 views

Letters and Symbols are printed when trying to store random numbers into an array [duplicate]

I've written this program to find 20 random numbers and store them into an array. Which then calls onto another class to print the array.( It was required to use two classes). Both of my programs ...
0
votes
0answers
7 views

There is a way to get the XSSFSheet hash password?

Someone knows why XSSFSheets doesn't provide a method to get its password like the HSSFSheet does with http://javadox.com/org.apache.poi/poi/3.13/org/apache/poi/hssf/usermodel/HSSFSheet.html#...
-2
votes
0answers
8 views

How to start with Spring Security for Restfull web services

I am interested in Spring MVC framework and would like to start my new way with Security. Can you give some piece of advices considering starting with this technologies?
0
votes
0answers
13 views

Get text snippets from google results

I want to extract the snippets from the google results, I'm using the following code that parse the google results page:Scanner scanner=new Scanner(System.in);System.out.println("Please ...

153050per page
angop.ao, elkhabar.com, noa.al, afghanpaper.com, bbc.com, time.com, cdc.gov, nih.gov, xnxx.com, github.com,