Questions tagged [java]

Java (not to be confused with JavaScript, JScript or JS) is a general-purpose, platform-independent, statically typed, 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. Use this tag for questions referring to the Java programming language or Java platform tools.

Filter by
Sorted by
Tagged with
-1
votes
0answers
5 views

JDK 13 compatibility with old JDK and New JRE compatibility with old JRE

I deleted my both old JDK (7 or 8, I don't remember) and JRE (7.80) and installed new JDK (13.1) and JRE (8u231). All of them is from Oracle. I want to know: Is code written for old versions will ...
0
votes
0answers
7 views

Does GridBagLayout affect JLabel images?

Currently trying to add a header image to my JFrame GUI, I've developed the layout of the project and everything looks good, but everytime I run the project the image does not load (no error messages)....
0
votes
0answers
14 views

Java Big File Sorter

I am doing an assignment for my class where I have a file that is 7 Mb. Essentially I am supposed to break it up into 2 phases. Phase 1: I add each word from the file into an array list and sort it ...
0
votes
0answers
9 views

JSON Error: Cannot login the android apps

everyone. Current I developed a system that requires the user to login. I use Android Studio (JAVA) to code the apps and PHP to connect from apps to MySQL database. Before the error happened, I use ...
0
votes
0answers
9 views

Maven: can not package local jar into final jar with maven and the error is java.lang.NoClassDefFoundError

The local jar is copied into /src/main/resources/, and add Maven dependency as How to add local jar files to a Maven project? <dependency> <groupId>com.yahoo.egads</...
0
votes
0answers
11 views

Java Apparent Dealock

I had a Db call on start up to get and cache the data and I'm getting to following. I have tried increasing the memory size on on my machine, no luck. Ive been reading about how this is a memory issue ...
0
votes
0answers
8 views

How to use dbus and NetworkManager to activate a connection

as per my previous SO questions, I'm still working on controlling NetworkManager via dbus from a Java application. I want to activate an existing wireless connection so here's my code, stripped as ...
-1
votes
0answers
7 views

JavaFX css not applying to TabPane

Im trying to change the style of a TabPane object. I loaded the css and I can apply styles to .root but its not working for the TabPane. I copied the css code from the default css and randomly changed ...
0
votes
0answers
14 views

How, in this insertion sort, does the array sort? I don't understand how the algorithm doesn't make the whole array the same number

public static void insertionSort (int [] array) { int shift, iterate, lock; for (iterate = 1; iterate < array.length; iterate++) { lock = array [iterate]; shift = ...
0
votes
0answers
5 views

ITextPDF Exception - for HR tag, not using HR

I am getting this error message "com.itextpdf.tool.xml.exceptions.RuntimeWorkerException: Invalid nested tag body found, expected closing ag hr." - while trying to generate a PDF. I am on tomcat 5.5 /...
0
votes
1answer
22 views

What am i missing in test class?

I keep getting the error (java:cannot find symbol Symbol: method getType()) and (java:cannot find symbol Symbol: method getCircleRadius()) Here is my Shape class: public class Shape { public ...
0
votes
1answer
10 views

How to verify if a servlet processing is really doing non-blocking io?

I am trying to receive an http request using non-blocking io, then make another http request to another server using non-blocking io, and return some response, here is the code for my servlet: ...
0
votes
0answers
21 views

Why does this type casting work and not throw me an error? [duplicate]

I came across this neat way of converting a specific char primitive to its equivalent ASCII value. int a = 'c'; System.out.println(a); // This prints 99 I think I understand how this works, but ...
0
votes
0answers
19 views

How to analyze CSV data from various files and output the results to another CSV?

I am a Java beginner and am having great difficulty getting my head around certain behaviors. I would greatly appreciate any guidance as I have hit a brick wall and don't know if what I have done is ...
1
vote
1answer
18 views

Java and Facebook. Can I connect to my own profile?

So I'm still an apprentice dev and I'm trying to make myself some challenges to improve myself. Short story if you're interested: I have a Spotify family subscription that I share with my family ...
1
vote
4answers
27 views

Why won't my recursive function recurse through all of the data in the stack?

I am trying to reverse a stack of type int using recursion. I am able to reverse the first entry, but it shows only zeros when I try to print the supposed reversed stack after the recursion takes ...
2
votes
3answers
44 views

Java stream, get map of lists of objects

Trying to get map of lists using java 8. I have array of predifined titles: String[] myStringArray = {"TITLE1", "TITLE2", "TITLE3"}; And list of some Pages objects (List of string). I need to ...
0
votes
1answer
10 views

FIREBASE : get data details from another child

I come to solicit your help on a problem that I have with my application. The problem is this: there are posts on the newsfeed that are in the database under this Posts -> [postid] location as on ...
-3
votes
0answers
14 views

NullPointer Excpetion Java Minecraft MySQL

I am developing a Minecraft / TeamSpeak³ Verify System right now. But when I wanna connect to my database it gives me a java.lang.NullPointerException . Here ist the code public class MySQL { ...
0
votes
0answers
9 views

Control a camera via telnet and remote server

I'm looking at ways of controlling a Mi Sphere camera via a mobile device. Usually you'd connect via Wifi and the app and communicate via a socket. This is OK, but for several reasons I need to ...
0
votes
1answer
16 views

Encrypt user password android studio

I am developing an android application , I use an Rest Api to send username and password in registration Now the data and the passwords are saved as plan text in the database What should I use or ...
0
votes
4answers
30 views

method chaining, returning an object from a list and getting values from it

what I have is a list of Dog objects, in the objects there contains a value that is a Boolean to show whether the dog as completed a training or not. What im trying to do is iterate over the list and ...
0
votes
0answers
8 views

Referencing existing FXML Controllers in MainController

I have multiple controllers in my project, but for now i will specify only 3 (MainController, CarController, ClientController). What i want to do is save all the data that was changed when exiting the ...
0
votes
0answers
10 views

I am trying to build the project and I have cloned everything from the GIT and during build issues I am having this below error

C:\Development\workspaces\Repositories\sales-oooweb\OOOBuild\build.xml:92: taskdef class weblogic.ant.taskdefs.j2ee.Appc cannot be found using the classloader AntClassLoader[C:\Development\workspaces\...
-1
votes
2answers
32 views

startActivity(intent); seems to always crash the app

When the app opens up, it successfully opens and runs our 'MenuActivity.java'. But when we click a button to launch a separate activity, "MainActivity.java', the app just crashes no errors or trace ...
0
votes
0answers
11 views

How to change a script function into a custom tag

I know I can use a function inside a script to hide and show elements in html/jsp like this: function hide() { var formular = document.getElementById('element'); formular.style.display = "...
0
votes
1answer
14 views

onKeyReleased does not work when a character is typed

I want to disable the button when the text fields are empty. I have created two fields with the onKeyReleased property
0
votes
1answer
20 views

How to make Status bar completely white?

At different times when using my app, the color of the status bar changes, the right would be white as in the first image, but at times it turns gray. What can this be? Android bug? Here it is ...
0
votes
0answers
11 views

NullpointerException when reading properties Weblogic Server

I have this problem in Weblogic 12.2.1: Extract from the log where the problem has been detected [log from the server] ####<06/12/2019 06:01:31 PM COT> <Info> <Deployer> <LIM-...
-1
votes
2answers
15 views

how to format groovy date time +0000

my api application does not allowed this date time format with +0000 behind it i have tried to format it by codes import java.util.Date import java.text.SimpleDateFormat def pattern = "...
1
vote
1answer
14 views

Is there a better way to accurately use geofences without writing my own location request service?

Accord to Android's documentation on geofences, the geofence should trigger when the user enters, dwells, or exits the geofence with respect to the asked request. BUT, testing the geofence feature ...
0
votes
0answers
30 views

Credit Card Validation having trouble with caculation

Your task is to: – Read the data listed below “Data to Evaluate” from a file. – Evaluate each number to see if they are representing a possible credit card number. – Validate each credit card number ...
1
vote
2answers
26 views

need help taking my key press listeners out of main

I have started to create a game where you can move freely. you move by using your keyboard I have it working but all I want to do is to take it out of main so I can call if multiply times from ...
0
votes
0answers
12 views

Receiving the error of not able to create an instance of the class Android ViewModel

So, I have this ViewModel and when I launch the app on debug mode it says that it can't create an instance of the class. I know the constructor of the viewmodel should be void, only with the super(...
0
votes
0answers
12 views

How do I access the _embedded portion of a HATEOS response in Java using the Spring framework

{ "_embedded": { "itemList": [ { "itemId": "1", "timeStamp": "2019-11-22T19:51:58.475538", "user": "User1", }, ...
0
votes
1answer
23 views

JOptionPane not returning correct value

Arrays are not allowed, the function was working but just returning 0 as if it wasn't counting the correct inputted character, but now its giving me a "string out of range: 3" This is supposed to run,...
-1
votes
1answer
25 views

Java Regex match with grouping using ()

When trying to match using this regex: TEST_([[a-z]+[0-9]*-){0,1}DD[0-9]{0,2}-ENV I get an error: Unable to execute regular expression. java.util.regex.PatternSyntaxException: Illegal character ...
-1
votes
0answers
22 views

Trying to create a train reservation thing [closed]

I'm trying to make a program that reads a file full of train seat information. It should search the line to see if the seat is free, and if it is, it should allow the person to put their email into ...
2
votes
0answers
13 views

Is it possible to use feature flags/toggles when feature modify database?

This problem confuses me the most when thinking about using feature toggles in applications. Most of the features require some changes in database. How then feature flag can be implemented to be able ...
0
votes
0answers
17 views

Many-to-One records Kafka Streams

I would like to turn many records into one per message. I tried many things like custom reducing and aggregators, but they all still send one-to-one records back out. For example I would like to ...
-1
votes
0answers
10 views

inserting data from jtable to array [duplicate]

so I am trying to insert data from two different columns in jTable into two different arrays using java as part of an assignment but im not quite sure how to do this. I need to put these into an array ...
0
votes
1answer
23 views

How to convert mqtt byte into string

In my method "MessageArrived" inside this parameter 'message' there is JSON data in a form of bytes. So I need to convert it into a string first to be able to have this string converted into a java ...
-2
votes
1answer
23 views

Is there a way to program Anylogic models completely with Java? [closed]

Since there are some event-listeners on several building blocks, I want to know how to access them in java or via a library/api?
-2
votes
0answers
31 views

Java - Passing Strings/Arrays by value [duplicate]

I understand that when you pass a string (reference type) into a method, the reference of the string gets copied. However, if you change this value in the method, surely that means the value of ...
0
votes
1answer
6 views

Java service using Jersey won't deploy to Jboss

I'm trying to build a Java service that other services could call. This service is not a WS, but is calling a RestfulWS. I'm really just building a wrapper around this call. This would find the ...
0
votes
1answer
11 views

Convert GregorianCalendar to XMLGregorianCalendar

While working with legacy code not yet updated for the modern java.time classes, I need to convert a ZonedDateTime to XMLGregorianCalendar. So I thought I'd go by way of GregorianCalendar, calling ...
1
vote
0answers
14 views

How can I inject properties for test and for main into each sub module of a multi-module gradle spring boot project?

This is the structure of my project. The parent contains no code. module child1 is a spring boot application. modules child2, child3 are jars libraries. child1 depends on child2 and child3 parent ...
0
votes
0answers
9 views

Automating Namecheap's browser DNS update with Java — can anyone give some suggestions to proof-of-concept code?

The domain name registrar Namecheap offers a service where customers can point their domains to their IP addresses simply using the browser. How do I use a browser to dynamically update the host's ...
0
votes
1answer
18 views

ImageButton doesn't overlap over the cardview, but a normal button // ImageButton no se sobrepone encima de cardview,pero un button normal lo hace

I am developing developing an app that at some point it will show some "study sheets". The problem is that for each item it should show two buttons that should overlap over the cardview, but it only ...
0
votes
0answers
14 views

Eclipse is not able to find chrome library

I am pretty new to Selenium world. I have been stuck with this code of opening a basic facebook page and it keeps throwing an error saying: Starting ChromeDriver 78.0.3904.105 (...