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

Error:Failed to find Build Tools revision 26.0.2

i know the title of this error may seem familiar , but beilive me I have done every thing to solve the problem , but I failed every time! so please help me!i dowloaded a code for and online shop app ,...
0
votes
0answers
28 views

Guess a number Java, need help prompt yes or no

I'm currently working on a small guessing game. I just need some help figuring why my Way too low won't work properly, also I'm trying to figure out how to add a Yes or No prompt once I got the good ...
0
votes
1answer
15 views

Error :“java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.chrome.driver system property” is displayed

Following is my code snippet :public class FindAllElementsFromTable {WebDriver driver;@BeforeClasspublic void beforeClass(){System.setProperty("Webdriver.chrome.driver","C:\\...
0
votes
4answers
50 views

Check if every element of an array belongs to a set of values [duplicate]

I need to create a boolean method which returns true if every element is 9, 1 or 6. public static void main(String[] args) {int[] nums1={ 1, 9, 1, 6 };int[] nums2={ 1, 9, 2, 6 };...
-2
votes
1answer
21 views

findElement is able to identify an element whereas findElements stops the execution

the below code stops the executionif(driver.findElements(By.id("create").size() > 0) {...}whereas the below code works without an issueif(driver.findElement(By.id("create").isDisplayed()...
-1
votes
2answers
14 views

sax parser getting nex value for empty tag

Im trying to get the values of an xm with sax parser, and when a tag its empty, like the parser instead of skip that tag save the value of the next tag, here its my parser:public class ...
0
votes
0answers
7 views

How to assign different paint objects to emoji and text in a string entered using remoteInput

I am working on an android wear watch face that will allow users to enter 12 characters into a text field on Canvas. I am using remoteInput which gives the user access to either microphone, emoji or ...
-1
votes
0answers
21 views

Generic Array Initialization [duplicate]

Due to implementation of generics in particular way, you cannot instantiate parameter directlyE[] array=new E[capacity];instead you have to do E[] array=(E[]) new Object[capacity];But If I ...
0
votes
0answers
18 views

(joda) lowercase z in date time format is returning offset, not abbreviation

I'm stumped. I must admit that I might not be looking in the right place for this bug. That said...We use dd MMM YYY HH:mm:ss z for the date format string. That lowercase z should return a three ...
-1
votes
0answers
51 views

Should ? super Object be used [duplicate]

Note: This is specific to Object because I do understand the uses cases and rules of other lowerbound wildcards.When tinkering around with generics and wildcards I thought about the uses of an ...
0
votes
0answers
9 views

Eclipse RCP performance

I have an eclipse 3.x rcp application which enables users to open multiple views having a GridTableViewer Widget with potentially few hundreds to thousands of rows each. The input is an ArrayList.I ...
0
votes
0answers
12 views

Can't open Netlogo files on web in the user community models

In the link below:http://ccl.northwestern.edu/netlogo/models/community/Water_Cycle_MSUI would like to use "run this model in your browser"However, when I click on it, nothing shows up. Can ...
1
vote
1answer
24 views

Read resources from specific JAR file (duplicate paths to file)

Let's say you have jar1 with artifactId zoo, and jar2 with artifactId animals. Both jars have a resource file with the same path (ex: /animals/animal.txt). Is there any way to read that file from a ...
0
votes
1answer
16 views

I cannot get OnSeekBarChangeListener to work in Android code

I'm trying to use OOP in my Java/Android code, but I don't understand why OnSeekBarChangeListener is not working in my new class.Is it prohibited to use a OnSeekBarChangeListener outside main ...
0
votes
1answer
14 views

Image size increased twice when convert from JPG to PNG using thumbnailator

Am using Thumbnailator to compress the image in my application. Everything is work fine alone when i try to convert the JPG image to PNG. At this process the size of an image getting twice after ...
-5
votes
0answers
13 views

Programs illustrating calculations using pseudorandom number generators for uniform distribution [on hold]

I need to create a program illustrating calculations using pseudorandom number generators (distribution diagrams). Generators of pseudorandom numbers for uniform distribution in java(method reverse ...
-7
votes
0answers
29 views

Can I implement a basic HTTP server in Java that supports directory listing? [on hold]

I am trying to implement a basic HTTP server that supports directory listing. Can I do that using Java? How?
0
votes
1answer
18 views

How to use SQL functions UPPER() and LOWER() with JPA query methods

I have a JPA Query method that gets rows by a column value like this:findAllByLastNameOrderBySortKeyAsc(String name)But I would like the query to be case insensitive. In SQL I can use the upper() ...
1
vote
2answers
20 views

spark scala : Convert DataFrame OR Dataset to single comma seprated string

Below is the spark scala code which will print one column DataSet[Row]:import org.apache.spark.sql.{Dataset, Row, SparkSession}val spark: SparkSession=SparkSession.builder().appName("...
-5
votes
0answers
14 views

Relative mouse movement library in Java? [on hold]

I am wondering if anyone knows of a library in java that will allow for relative mouse movements, like what C++ has with the mouse_event function when including "windows.h". I'm trying to move the ...
0
votes
0answers
6 views

Why is the method setByJar used?

Why is the method setByJar used? I referred hadoop docs which states set jar by finding where the class came from. What does that mean?
0
votes
1answer
22 views

Retrofit doesn't call onReponse and onFailure

In my case I have used retrofit to contact with rest api. Unfortunately when i start it never reach onResponse and onFailure state neither. I checked in debug line after line and it looks that he ...
0
votes
2answers
27 views

Android app crashes when changing intent

I'm making an app but I have a problem: In my MainActivity.java there are only 2 buttons, and when I click them, they should change Intent (every button has a different intent). Android Studio ...
0
votes
0answers
16 views

Unexpected behaviour of getChildCount

I has used this to getchildrencount and put it on text view but when I come back again the value disappear{mDatabaseLike.addValueEventListener(new ValueEventListener() {...
0
votes
0answers
6 views

PopupWindow not displayed on some phones

I implement PopupWindow in my Activity and it works fine in some phones (Redmi 4x) but not on others (Redmi 3) it does not show at all.I think I implement standard PopupWindow, but maybe the issue ...
0
votes
0answers
15 views

How to make generic jackson reader? [duplicate]

This is json:[{"id": 1},{"id": 2},{"id": 3}]This is Pojo for this json:public class Pojo {int id;public Pojo() {}public Pojo(int id) {...
0
votes
1answer
22 views

JPA: problems with translated tables

I have a problem with JPA (using Spring and Hibernate) when having 2 tables, one of them represents the translation of the other one. My intention is to retrieve the whole information of the ...
0
votes
0answers
6 views

Fallback to local config if spring vault config is disabled

For development environment I have configured bootstrap.properties to disable vault configuration.spring.cloud.vault.enabled=falseIf it is disabled then application should read the properties from ...
0
votes
1answer
24 views

Android app crashes when retrieving data from SQLite database

This is the retriver method: public Cursor getData(String subj) {String selectQuery="SELECT " + subj + " FROM " + TABLE_PRIMEIRO;SQLiteDatabase db=this.getReadableDatabase();...
-2
votes
2answers
39 views

Java creating program that validates password [on hold]

I have to write password validation program.You will have these methods:main(String[]): calls getValidPasswordgetValidPassword(): checks that the password has all criteria and prints the ...
-3
votes
0answers
27 views

Do not apply a TIF texture to the model

The .TIF texture is not superimposed on the model. The model is displayed in a blue background, tell me what is the problem? JUST DOES NOTHING HAPPENS, I DO NOT KNOW WHAT TO DO///.http:///...
0
votes
0answers
20 views

How to mock Iterable Array using Mockito Iterable<int[]>

Code:for (Int[] dArray:apData.createvaluetraversalbasis(nbvautoxpathconstant.DRIVER))Here Return type of this method createvaluetraversalbasis is Iterable int[]. I tried to mock this as below. ...
0
votes
1answer
7 views

Error:(7, 0) Gradle DSL method not found: 'google()' Possible MyPartyPlot' may be using a version of Gradle that does not contain the method. \ [duplicate]

Error:(7, 0) Gradle DSL method not found: 'google()'Possible causes:The project '1BookMyPartyPlot' may be using a version of Gradle that does not contain the method.Open Gradle wrapper fileThe build ...
-1
votes
0answers
19 views

How to save and load game using serialization

I have a game writing in Swing and want to add save and load functions. The main idea of my game situated in class MyFrame(). My game starts when the class MyFrame() starts. So I tried to serialize ...
-7
votes
1answer
69 views

Java 8 iterate two lists and filter and put values to a map

I want to iterate two lists like below and I'm kinda stuck writing this with Java 8 streams:List<Map<String, Object>> samplesList<Map<String, Object>> valuesif I write the ...
0
votes
0answers
13 views

Periodic data ingestion from mongodb to csv

We have a data producer source (mongodb) from where we are consuming data. We need to periodically move data (15 min periodically)from different mongodb collections to different csvs through a lambda ...
1
vote
1answer
34 views

Sending Data from Activity to Fragment Using Arguments (Kotlin/Android)

I am trying to send data from an Activity to it's child fragment. I have one activity that first loads all the fragments like this: view_pager.adapter=TabsAdapter(supportFragmentManager)...
1
vote
0answers
26 views

Ping failed, unknown system variable 'language'

I'm trying to connect Eclipse to phpMyAdmin but when I'm trying to do a Test Connection I get this error:Ping failed! java.sql.SQLException: Unknown system variable 'language'at com.mysql.jdbc....
0
votes
0answers
14 views

FusedLocation is not always accurate

I'm developing an app for my work. It's main goal is to verify if workers are in the place they're supposed to be. So, they Check-in at a pint of sale, and immediately a tracking Job is fired, getting ...
0
votes
0answers
9 views

Cannot get AudioClip to work with Javafx

I'm trying to get AudioClip to play a WAV file using my Professors animation template but I can't seem to get it to work. I get the following errors:Exception in thread "Thread-4" java.lang....
0
votes
0answers
25 views

Why is Eclipse setting carriage returns(\r) when Carriage return+newline(\r\n) is supposed to be the value

I've been trying to format some text using java on a windows virtual machine. Text from the file looks like: LocalRPLSTRGKD2Rcpt/DisbI'm trying to replace this text block ...
0
votes
1answer
26 views

Want to load the content dynamically when user click on some required contents thymeleaf

I am very much new to thymeleaf and i have been working on project that works great in jsp.Now where i have to move to spring boot i am facing some problems. i have this controller i want when user ...
0
votes
1answer
32 views

Potentially simple math - Prime Number Code

I'm having some trouble getting my head around this program that's used an example in a guide book. It might be more of a math question than a coding question. Edited to include code!// Find prime ...
0
votes
0answers
10 views

Set proxy for StandardWebSocketClient handshake?

Is there a way to be able to on the fly set the proxy settings when establishing a Websocket connection through Spring's StandardWebSocketClient class? What's the best way to confirm that I am ...
0
votes
1answer
19 views

Issues adding data to Firebase Realtime database

So I'm having a strange issue with Firebase, and I can't seem to find any info on it. I'm attempting to add a user object to the database. When I check Firebase, it's created an object with the ...
0
votes
1answer
23 views

Spring Data with strict In-clause

I want to query for elements where every element is required to have all given attributes of e.g. a set to be returned, not only one.Default Spring Data Jpa Query, where one attribute is enough:...
0
votes
0answers
20 views

Java scanner. Why do I get could not find file when running this?

Java scanner. Why do I get could not find file when running this? Am i doing something wrong. I know the file exists in the directory and there are a few lines of text in it. Its a file with no ...
0
votes
1answer
36 views

Java storing and getting from class

Is it possible to get values from the class based one one value? Something very much like a SQL WHERE statement.class :private String aid;public String text;public class B{public B(String a)...
0
votes
2answers
47 views

Unexpected getter behaviour

I'm having a little problem with the challenge assignment for one of my courses. This code is supposed to list all of the contacts contained in the array list by names of the contacts. I have made a ...
-5
votes
1answer
62 views

What does “([%_])” regex mean in Java? [duplicate]

What does the following code/regex do in Java. I am looking at code written by another dev, but I can't make what the following regex does? str.replaceAll("([%_])", "\\$1");I see the well-known ...

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