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
answer160
viewsApache Tomcat Eclipse Java IDE
Hello, I’m having a problem with booting my Tomcat server, first he accused that problem of "Localhost already in use", after searching about I changed the ports and he climbed the server for a…
-
0
votes1
answer41
viewsWeb service for java desktop
I have a question. How is the request made for a php page using java desktop? Should I create another project for java web?
-
0
votes1
answer209
viewsCannot find Symbol - NETBEANS
I was programming, so far so good, but when 'getar' +txt_endereco.gettext()+ gives cannot find Symbol, when I go 'setar' the same thing 'txt_endereco.setText(model.getValueAt(indexrow, 4).…
-
0
votes1
answer384
viewsJava project that requests two user numbers, and prints all integers between the first and the second number
int maior ; System.out.println("digite um numero"); menor = support.TextConsole.getInt(); System.out.println("outro numero"); maior = support.TextConsole.getInt(); do{ menor = maior; menor++;…
javaasked 5 years, 6 months ago user142991 1 -
0
votes3
answers2337
viewsHow to count characters from a String ignoring whitespace?
I’m trying to make a return in the variable to count how many letters there are in the typed word and ignore the typed spaces, but I don’t know how to join the length with the trim, says the…
javaasked 5 years, 6 months ago Julio Vieira 39 -
0
votes3
answers4692
viewsUnable to start Activity Componentinfo
The app doesn’t work when deploying. It "crasha" straight. Follow the code and error: Actmain.java package desenvmoveluss.com.br.trabalho01; import android.support.v7.app.AppCompatActivity; import…
-
0
votes1
answer318
viewsDenied error when connecting spring boot to mysql
I’m trying to connect with mysql but only this error: Caused by: org.flywaydb.core.internal.Exception.Flywaysqlexception: Unable to obtain Connection from database: Access denied for user…
-
0
votes1
answer226
viewsJava - what is the <?> and GENERIC TYPES for?
I’m not sure, but I suppose the question is part of Reflection do Java, but I wanted to know what it is for, and where I can study generic types, preface in Portuguese, because my English is not…
-
0
votes1
answer112
viewsError while doing image url GET on Json Android
I have the following code: private class DownloadJsonAsyncTask extends AsyncTask<Void, Void, Void> { @Override protected void onPreExecute() {...} @Override protected Void…
-
0
votes2
answers416
viewsList always returns only the first row of the sqlite database
I have a list, which shows all the data of the sqlite database, image path, latitude and longitude, but in the list only changes the image path, latitude and longitude always remains those of the…
-
0
votes1
answer190
viewsStudent of Kotlin
I am studying Kotlin and I am learning about builder, I would like to know what the difference is and when is used a primary builder and a secondary builder examples: Init Constructor And set…
-
0
votes1
answer86
viewsParameters in Static attribute
I have the following attributes in my class: static String URL="jdbc:jtds:sqlserver://blablabla; databaseName=Pxx"; static String usuario; static String password ; static String…
-
0
votes1
answer47
viewsHow to call the method of one class within another (bluej)
Here’s what I’ve been doing public void valorConta(){ int i=0; float totalConta=0; for(i=0;i<listaligacoes.length;i++){…
javaasked 5 years, 6 months ago Marcela Braga 45 -
0
votes2
answers57
viewsTable only fills the column title
I wrote the method below: public void setListaCompra() { String sql = "SELECT * FROM\n" + "(\n" + " SELECT \n" + " produtos.id AS id, \n" + " nome_produto AS Nome, \n" + "…
-
0
votes1
answer334
viewsAndroid consuming web service Soap
I’m developing an application to search the response server, I send the boleto number and your type. Only when I send the data he doesn’t send me a return, what I might be doing wrong? package…
-
0
votes1
answer165
viewsHow to resolve error: illegal Static declaration
I have 2 classes that work well independently of each other. I joined the 2 in one and got 3 build errors, the error message says: ilegal static declaration. how to solve error on lines 42, 58 6 69.…
-
0
votes0
answers147
viewsSelenium with Maven plugin does not work the tests
Implementation to run a Junit and testNG test suite, When executed by the eclipse plugin, it works. By Maven no, the behavior of testNG tests, are changed, It seems that the http sessions do not end…
-
0
votes1
answer47
viewsError in Facesconverter with variable type Date
I am getting the following error while running a web project: java.lang.Classcastexception: java.sql/java.sql.Date cannot be cast to br.faraway.Nicholas.converter.Sampleentity My page on which I…
-
0
votes1
answer141
viewsRegister button for the application
I’m developing an app and it has user registration and login, I’ve done a lot already, but every time I click the button to register user, the app to, could anyone help me? Follows the code. Class…
-
0
votes1
answer80
viewsHow to fix this code in Java?
Good evening, a teacher sent to class some exercises in Java to do, but as we are at the beginning of the course and I had no basis before, I’m having trouble solving it. Someone could guide me? The…
javaasked 5 years, 6 months ago game-extreme 3 -
0
votes1
answer40
viewsWhen trying to generate report I come across this error! I am using Jasper
I am using a Composite to print out reports Note: I can send the report with my City usually the problem is with the material. Menu Impressão Composite <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML…
-
0
votes1
answer97
viewsLimit the size of Linkedhashmap
I need to limit the output size of my Linkedhashmap: It receives an undetermined number of information that needs to be reduced to no max 20 records: I put a limit on the function below, but I had…
javaasked 5 years, 6 months ago Rodrigo Nantes 143 -
0
votes1
answer25
viewsEndpoints using Vraptor
I have a problem here but I do not know if it gives p/ solve . I have a method that has many parameters so I made a kind of filter, and it was like this : @Get("") public void findByFilter(Filtro…
-
0
votes1
answer449
viewsSet text of selected item in Spinner for an Edittext
First of all forgive the lack of knowledge and technical errors, I’m starting in the area. I need to send the information of a spinner to a database and the solution I proposed was to set the text…
-
0
votes1
answer68
viewsHow to restrict access to the Java API using Spring Security?
Hello. I have an API in my back-end that provides the data for my web application (web ad query application). The application has no login and password, so few registered users. It is an application…
-
0
votes1
answer46
viewsDatabase query, main class returns zero
I am making a query by taking only one field and one line and setting in a variable of the main class, the question is that within the Try below, the variable shows the result of the query correctly…
-
0
votes1
answer143
viewsTrouble catching latitude and longitude
My code was working, I was getting latitude and longitude normally, but it stopped and I’m not getting the location anymore. It only falls on the condition that it was not possible to pick up the…
-
0
votes1
answer124
viewspublishProgress only updates the Progress Dialog at the end of theInBackgorund
I am unable to update the progress of my Progress dialog during the insertion process into the Sqlite database from a JSON array. The process occurs smoothly, however, the update only happens at the…
-
0
votes0
answers61
viewsMemory Leak error in connection drivers when trying to launch Tomcat
I have a Java/Vraptor4 application on a Tomcat9.0 , when I am climbing up Tomcat the following error is released: abr 09, 2019 10:50:13 AM org.apache.catalina.startup.VersionLoggerListener log…
-
0
votes1
answer574
viewsJava Web login/authentication screen
Good morning guys, I am seizing Java web but my login screen is not logging in and not giving error signal when clicking enter. Working class import javax.persistence.Column; import…
-
0
votes0
answers73
viewsUpdate fragment after clicking button
I have a Fragment called Fragmentopedidos with a button that adds a new item to a Recycleview, and this Recycleview is in a separate class: Adapterhistorico.java. Each item in this Recycleview has…
-
0
votes1
answer854
viewsAdd functions in graphical application buttons
I’m having trouble putting functions for java buttons. Can anyone help? Follows the code: import java.awt.Color; import java.awt.Font; import java.awt.Graphics; import java.awt.Insets; import…
-
0
votes1
answer66
viewsJava type incompatibility
String query = "INSERT INTO codigos(Nome,Codigo) VALUES( '"+nome+"','" +codigo+ "')"; rs = st.executeUpdate(query); rs is a resulset, st is a statement, an error appears to say that there is an…
-
0
votes1
answer445
viewsException in thread "AWT-Eventqueue-0" java.lang.Nullpointerexception to write to Mysql database
Good evening, everyone! I am having a problem recording the activity log of my system, the situation is the following the system is a multi user chat socket in my class that contains the graphical…
javaasked 5 years, 6 months ago Patrick Carpezani 1 -
0
votes2
answers567
viewsIs it possible to use the external terminal when running a Java program through Netbeans?
What I mean is, I can switch to getting Netbeans output out on Linux bash or Windows cmd instead of using the internal Netbeans application console?
-
0
votes0
answers44
viewsError: Datamodel must implement org.primefaces.model.Selectabledatamodel when Selection is enabled
I am implementing a selection list (Datatable) but I only get this error: Datamodel must implement org.primefaces.model.Selectabledatamodel when Selection is enabled. Follow the code below:…
-
0
votes1
answer116
viewsReturn the second largest element of a binary tree
I am having trouble creating a method that returns the second largest element of a tree. My return code the largest element was like this: public int maiorElemento () { return maiorElemento(raiz); }…
javaasked 5 years, 6 months ago Stenio Maots 1 -
0
votes0
answers67
viewsJava - XML File - Empty Final File
I have a Java webservice that is triggered to perform integrations via exchange of XML files with an ERP, it worked perfectly from the day I developed it. Yesterday morning, it went on to generate…
-
0
votes1
answer77
viewsHow to subselect/subquery using Criteria
Can someone help me find the problem of this consultation : CriteriaBuilder builder = em.getCriteriaBuilder(); CriteriaQuery<Solicitacao> query = builder.createQuery(Solicitacao.class);…
-
0
votes4
answers52
viewsIs my char checking logic wrong?
I am reading a row of a file and I need the loop to stop when I find a space or a =. I did the code below but it is not working, even if it has space or = on the line, it continues the loop. for…
javaasked 5 years, 5 months ago Gustavo B. 13 -
0
votes1
answer48
viewsSave object to a list not the reference
The problem is the following I try to save the object in a List and what happens is that it saves the reference not the object someone can help me to solve this problem?…
-
0
votes1
answer523
viewsHow do I write data from an Arraylist to a txt file (in addition to reading the file when starting the program)?
Full Project Github Repository /*a human resources company specialising in market relocations (job vacancies), calls for the creation of a system to computerize its actions. Thus, she wants to…
-
0
votes1
answer74
viewsHow to read a file that is inside an EAR
I have the following structure of an Ear application myApplication.Air /META-INF/file.properties War/WEB-INF/lib/myLib.jar/myClasse.java file I would like to retrieve the file from my Classe.java.…
-
0
votes1
answer112
viewsHow to transform a string into an array
Good guys, next how can I turn a string into an array? For example: String test = "345,421,888,211"; Explaining the context, these values are Id’s that I concatenated into a string from a grid.…
-
0
votes1
answer148
viewsWhite Space selectOneMenu
I would like to know if it is possible to remove a blank field in selectOneMenu, I have the following case, I have a selectOneMenu that displays several names, some names that I do not want to…
-
0
votes1
answer51
viewsHow to add Asynctask to this task?
Hi, could someone help me add an Asynctask to this task? Here I am connecting to a JSON for information, then it will be added to Recyclerview. RequestQueue queue = Volley.newRequestQueue(this);…
-
0
votes1
answer291
viewsHow do I close a dialog when the condition is true?
How can I make a custom alertDialog close after the user activates the gps? The dialog box tbm can not close while the gps condition is false, that is, while it is disabled alertDialog has to…
-
0
votes0
answers595
viewsDoes not recognize/find Java Classes in Eclipse
I was using Netbeans and had no problem. I migrated to Eclipse a short time ago and now I went to make a code and Eclipse doesn’t even recognize the main Java Classes. System, Scanner, etc. What…
-
0
votes0
answers45
viewsJava Web / Glassfish application stopping
I’m having a problem and unfortunately I’m not finding the cause. I have 3 Java Web applications running on a Glassfish server and what happens is that these applications suddenly stop working.…
-
0
votes2
answers224
viewsHow to load 10 records from a Java list?
I’m with this Java method; public String detalhesHistorico() { listaHistoricoRemessa = historicoRemessaService.listar(historicoRemessa); return "ajax-modal-historico"; } Is there any java method…