Most voted "java" questions
Use this tag when the question refers to some resource, information, or problem relating exclusively to the Java programming language. Java is a class-based, statically typed, reflective, and execution environment (JRE) language. Java programs are compiled to bytecode and run on a virtual machine (JVM), allowing a "write Once, run Anywhere" philosophy (WORA).
Learn more…14,468 questions
Sort by count of
-
0
votes1
answer104
views(JAVA) How to treat Exception with spring?
In my model I declared this code to be unique. @Column(unique=true, name = "codigo") private long codigo; At the time it is displayed in the api and I inform equal codes for two employees appears to…
-
0
votes1
answer137
viewsHelp with While in Java
I’m starting in Java and I was left with a question about how to insert a While loop in the code below. It’s a simple code I’m doing to practice, but I can’t seem to create While in it. I would like…
-
0
votes1
answer32
viewsError, Sum of values in a Jtable
Good evening guys, I’m trying to implement a method that adds up the values of the lines of a JTable, but is always returning 0... Follow my Code. private void loadData() { List<ValoresEntity>…
-
0
votes2
answers486
viewsConversion from comma to java point
I’m having a hard time getting my own getPreco() be formatted. The input of the data is by means of a textField. if (radioGuitar.isSelected()) { Guitarra guitarra = new Guitarra();…
-
0
votes0
answers38
viewsAccess denied for user 'root'@'localhost' (using password: YES)
Good afternoon Guys, I’m trying to create a table using Hibernate in Java, the database used is Mariadb, but when compiling my Java class this error occurs below. I have already checked the class…
-
0
votes1
answer323
viewsHow to Update Only Some Put Fields in Springboot
Hello People Explaining speed the code this endpoint there is my route updating an already registered student I enter with the data I want to register and send to update function and la "Arrow" data…
-
0
votes1
answer86
viewsCalculation of Age using Period
I have this code below in Java that does not compile and I can not find the error. I have already made the targeted modifications and the number of errors has passed to only 1. The method…
-
0
votes1
answer62
viewsActivity Access via Manisfest File - Android
Hello, everybody. I’m trying to build an app inspired by pokedex for a challenge, and trying to use the MVC architecture. I’m having problems accessing the activities (that are inside the packages I…
-
0
votes1
answer36
viewsJPA+Eclipselink Composite Key with Object
I am creating a class of stocks where the key of the table will be the product code+local, so that the system can control various stocks of the same product in different locations. I created an…
-
0
votes0
answers80
viewsConvert String from an array to Int - Java
I have a.csv file that has three information inside it, a name, a price and a quantity, needed to convert the amount that is in this file separated by "," to an Array and then pass as parameter in a…
javaasked 4 years, 9 months ago Felipe Bruno 21 -
0
votes1
answer92
viewsOracle Session date format for running Stored Data
Talk guys, all good? I have a little problem that may be simple to solve, but I could not find solution so far. I have procedures stored in the oracle database that need to be executed, however I am…
-
0
votes1
answer33
viewsload . txt from internal storage in an array
I’m making a stock count app and it needs to import a txt and export the same with the quantities read in the count, the problem is that searching found the library android studio to load the file…
-
0
votes1
answer123
viewsPass Data to other Javafx screens
People who work with Javafx, I need a lot of help, I’m trying to pass data from one screen to another but I can’t. In my project I log in with a user searching in the database. Each user has one id.…
-
0
votes1
answer54
viewsMap data like Mysql TIME to JAVA above 24 hours Example (37:26:30)
I have a system that I need to bring Mysql database time information above 24 hours to Java. We use Ibernate and it’s like this; In the bank the data is as TIME (37:13:36) example: TEMPO_REPOUSO…
-
0
votes1
answer129
viewsError when requesting API
I’m getting an error, possibly from CORS, when making a GET for an API, which is a third-party API and I don’t have how to release server-side CORS: Exception in thread "main"…
-
0
votes2
answers134
viewsError printing Array List in Java
I am making a code where is created an Arraylist class "Employee" public static void main(String[] args) { int qntFuncionarios; Scanner sc = new Scanner (System.in); List <Empregado> list =…
-
0
votes1
answer16
viewsstopService() works on only one device
I am developing a streaming application and whenever a new song is chosen the application for the service that is playing the current song and then starts it again with the new song chosen by the…
-
0
votes0
answers53
viewsProblem consuming Rest API
I am trying to consume an api, but it is not returning an internal list, it only returns totalSize and done. Code: public List<PessoaResponseDTO> get(String url) throws Exception {…
-
0
votes1
answer26
viewsError while deploying appengine
I have this project in spring, runs locally with appengine, but when I deploy, it error it in appengine org.eclipse.jetty.annotations.ServletContainerInitializersStarter doStart:…
-
0
votes1
answer56
viewsWhen a validation is negative I would like the program to return, so I can enter the data again
I have a switch that validates 5 cases, but already in the first if you do not enter a number that is not among 5 of mine case, it shows that the option is incorrect and closes. I wish the program…
-
0
votes1
answer89
viewsUse . bat cls command in Java language
I have a code to start a session at Putty, with an IP address for a piece of equipment from each city. Inside the java code, I use . bat commands, for example the |CLIP command and start Putty.…
-
0
votes2
answers366
viewsMy real ads do not appear in my app, only the test ads
Good afternoon, I’m making an app and I’m setting up the ads part using google admob, but when I put my ad ID does not appear in my app, it appears only with the test ID. I’m using an emulator to…
-
0
votes2
answers740
viewsMultiply a matrix by a vector
I need to make a program that multiplies a 3x3 matrix by a vector 3, and store the result in a new vector. But I can’t get the result and the problem is probably multiplication. public static void…
-
0
votes1
answer144
viewsPointing to an FXML file in javafx
I created a project from scratch, was without any folder and opened the window perfectly, but when I put inside 7 folders and then started not to load. Does anyone know how I would point? I’m using…
-
0
votes1
answer123
viewsProblems with Java Scanner
I’m having trouble compiling a basic reading program written in java, when I compile it gives continuity errors in the console. package programa_leitura; import java.util.Random; import…
-
0
votes1
answer44
viewsTips for making a cleaner code
Starting in java programming and would like to know how to make code cleaner, this is an example of a recent code I created public void chamarButton(JTextField login, JTextField senha){ String pass…
-
0
votes1
answer197
viewsJPA connection to Firebird error
I always used mysql for the database, but now I have a need to connect with a band Firebird(FDB) in a project, I am using Maven, when trying to connect spring returns me the following error: Caused…
-
0
votes1
answer1422
viewsConvert String to Date From yyyy-mm-dd to dd-mm-yyyy format
I made a Java endpoint that contains the date information. The date is received as string in the format 'yyyy-mm-dd'. I need to convert to Date dd-mm-yyyy format. I am using the following format…
-
0
votes1
answer1257
viewsError: Could not find or load main class Integers Caused by: java.lang.Noclassdeffounderror: javaLoiane/aula11/Integers (Wrong name: Integers)
When I compile with javac, it works normally but when I try to execute the compiled code ex:"java Integers" this appears: Error: Could not find or load main class Integers Caused by:…
-
0
votes2
answers43
viewsWhy can’t I use Stringbuilder’s delete() method more than once in the same code block?
I’m trying to erase an interval of content from a StringBuilder, but when using the method delete() more than once the program gives error. Specifically, I’m trying to delete the pseudo-code part of…
-
0
votes1
answer114
viewsHow to convert hexadecimal to decimal received by socket
I need to convert a hexadecimal entry in the client to decimal, but I couldn’t find information on how to do this. Example of socket server: byte[] HEXA = {(byte)0x00, (byte)0x96, (byte)0x07,…
-
0
votes1
answer31
viewsChange daughter class output in a time counter
Good morning, I’m trying to create a basketball scoreboard to start learning programming in java/android studio. I have created a class for the game time clock called timer that is working very…
-
0
votes1
answer41
viewsHow to return data through the Java Criteriaapi from more than one table?
I have a class that doesn’t persist: Peopleware.java public class PessoaDadosSearch{ private Long idPessoaDadosSearch; private String nome; private String cpf; private String municipioResidente;…
-
0
votes1
answer304
viewsAdd a new object in a list in another class
I populated a list of dishes from a restaurant, after that, I added a function for the user to create a new dish when they want. However, in the method to create the new dish, I cannot add to the…
-
0
votes0
answers358
viewseclipse does not recognize jdk 9, 11 or 14 (Target is not a JDK root. System library was not found.) windows 10
I’m trying to test JDK9 with Eclipse (version 2020-09 M3 (4.17.0 M3) and also tested with Oxygen Release (4.7.0)) on Windows 10. I installed jdk with the installer for windows…
-
0
votes1
answer348
viewsHow to do for instantiating a new JAVA object
I’m in my first object-oriented programming classes and I’m having difficulty with an evaluation. Create a class with at least 10 attributes for creating objects of the Computer type. The class must…
-
0
votes1
answer1084
viewsSum of the elements of the secondary diagonal of a matrix
I made a program that the user declares the size of the matrix, and the matrix numbers are random. But in the sum part does not work and displays many errors. Java public static void main ( String[]…
-
0
votes1
answer75
viewsShow item of an Arraylist in a Jtextfield
Good evening community, I have a problem in a Project I am working, I created a table in mysql with a few words, after that I made a Resultset of this table and saved the names of the words obtained…
-
0
votes0
answers84
viewsError making a POST request with Springboot
I have the code below: String url = new StringBuilder().append("https://...").toString(); Map<String, Map<String, String>> body = buildBotBody(email,message);…
-
0
votes0
answers17
viewsUse Datatable with Lazy within several p:tab
I’ve been looking at some places like making a datatable with Lazy, so I can only upload the page data in display and not overload the server. But all the examples used only one table. I have a…
-
0
votes0
answers38
viewsTransform Delimited String into Nested Json (Java)
Good afternoon, I would like your guidance, I am a little confused on how to proceed in a situation in Java + Spring Boot. I get from the database 2 columns of strings, the first is a path delimited…
-
0
votes0
answers50
viewsCall a PL/SQL precedent by passing a date as parameter
I have a PL/SQL design ( LnCDOrigem IN Company.COD_CD%TYPE, LnSotoreOrigem IN Company.COD_STORE%TYPE, LvTipoEqpt IN VARCHAR2, LdDtMovimento IN DATE, LnRetorno OUT NUMBER) When I make her call…
-
0
votes1
answer44
viewsHow to use function to sum 3 matrices
I’m having trouble creating a function. I have my program ready, but I’m doing an exercise where the function is mandatory and I’m not getting. Java public static void main(String[] args) { Random…
-
0
votes1
answer45
viewsChange the color of only one of the bars/columns of the graph generated in PPTX - Apache Poi
I’m working with the Apache Poi v4.1.2 in the Java for file generation .pptx, slide display on PowerPoint. I’m basically using the Apache Poi to generate slides with graphics, so far so good, I am…
-
0
votes2
answers78
viewsPrint variable in java
excuse ignorance, but I am learning alone and reading a lot, I am at the beginning, I need to generate a password by calculating day * month * year, I created the variable that calculates this but I…
-
0
votes0
answers52
viewsReturn calculation to jsp with a Servlet
Good afternoon, I have just graduated in computer science and I’m looking to enter the area of programming. I still have a lot of doubts in web programming but I’m already starting to develop some…
-
0
votes1
answer93
viewsThis method must Return a result of type int[][]
I’m trying to do this matrix multiplication function but it’s giving error. Shows that the error is mult(int row, int column, int Linha2, int column2, int[][] matrix, int[][] matriz2) and says 'This…
-
0
votes1
answer50
viewsMultiplication of 3 matrices
I have to multiply three matrices with the validation that you can actually do, in one function. I’m trying to do matrix 1 and 2 first and get the result to do the 3. But it’s going wrong and also I…
-
0
votes0
answers32
viewsDelay when switching video with Videoview
Hi, I’m having a problem with a delay when making the video exchange of a playlist that contains images and videos as soon as the video ends in a Videoview. The delay is about 200ms in my tvbox.…
-
0
votes0
answers15
viewsEclipse 2018-09(4.9) does not create java files in openSUSE Leap 15.2
I installed the eclipse by Leap Discover, but after defining Workspace and creating a project, I tried to create a project java but only the options appear: file, Folder, project, Untitled Text…