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
answer144
viewshow do I search the groups the user participates in Firebase?
I have an android app java and want to know how I do a search of the groups that a user participates... how do Join to search only the groups that the user participates in (the Attendee table links…
-
0
votes1
answer499
viewsHow to read . sql file with Java
I have a complex query in Mysql with sub-select and joins. I would like to read this script through a file .sql using the language of JPA/Hibernate (JPQL or HQL), for example…
-
0
votes0
answers73
viewsHow to disable the on Stop method?
I am developing an app and am using 3 Fragments in a slider layout. And when I slide from the first tab to the third tab, my first tab calls the onStop method and consequently, everything in that…
-
0
votes1
answer171
viewsError compiling robocode
Good afternoon! I’m having problems compiling the example Robo in Robocode, where is presented the error below: Compiling... Unable to load Annotation Processing manager…
-
0
votes1
answer1081
viewsProblem with file transfer via java socket
I am trying to make a client/server program that accepts more than one client and that client sends files to the server. The transfer was working properly, however when I put a while so that when…
-
0
votes1
answer394
viewsFilling in automatic data - JSF
I need to have my inputs filled automatically, after selecting the combo. I have done the method to go through the database and retrieve the necessary information, but does not fill... Can anyone…
-
0
votes1
answer208
viewsCan anyone tell me why my console doesn’t show up as a result of anything?
Receive a value n and print the following table using the structure chaining for: 1 2 4 3 9 27 4 16 64 256 n n² n³ ... n^n I tried to: import java.util.Scanner; public class Questao4 { public void…
-
0
votes1
answer140
viewsHow to make a delay or cause a wait on Android?
I have a for where it sweeps a vector String, sending command completed increment . for(int i=0; i < msg.size(); i++) { enviarComando(msg.get(i)); } When he sends I want him to wait 1 second for…
-
0
votes1
answer74
viewsHow to check and take the value 0 or 1 of a string and save that number to that column?
I have to keep the number 0 in a variable desc and 1 in the variable asc, if one of these values is found in the string. How do I do it? package testes; import java.util.ArrayList; import…
-
0
votes0
answers39
viewsSonnar Error In Java Classes - Add Copyright
I’m dealing with an error in Sonnar and an error has appeared in all my classes to add a Copyright Header. **Add or update the header of this file. ** I’ve done that, but the mistake goes on. My…
-
0
votes1
answer1216
viewsReading of Java XML
I’m trying to read an XML in Java to get data from an NF-e. I tried so to try to get only the product code to test more unsuccessfully: public void testeaa(String xml) throws DocumentException {…
-
0
votes1
answer65
viewsCode does not update in Hibernate JPA in Eclipse
Hello guys I’m making a system to sharpen a little my techniques and I came across a problem. I modified my code a little while ago but when I went to debug it looked like it was running the old…
-
0
votes0
answers248
viewsEntities export error - Hibernate
Good afternoon, everyone! I’m trying to create the database tables from the entities I created in the project. When I ask to create the tables and display the database creation script by Eclipse I…
-
0
votes1
answer148
viewsWrite to worksheet from last line without overwriting
I am trying to write in an excel spreadsheet from the last line written without deleting the content that already existed, I have already managed to pick up the last line and write from it, but when…
-
0
votes4
answers232
viewsPage rendering error after system navigation
I have a problem with a developed system which is that as the user browses the system after a certain time the pages do not render but return when the user updates the page. I researched a lot but I…
-
0
votes1
answer788
viewsHow to compare all values of an array with a variable
I wonder if it is possible for me to have an array with multiple dates and to know if another date is larger than all the dates within the array. For example: Date[] datas =…
-
0
votes1
answer2358
viewsMy . jar files generated by Eclipse are not opening
I’ve done everything I know and found on the internet to open a file. jar, but nothing works. When I do 2 clicks it just doesn’t open, it doesn’t error, but it doesn’t open anything either. I have…
-
0
votes1
answer317
viewsError while compiling Android
When compiling, the following error occurs: :app:transformClassesWithDexForDebug FAILED Error:1 error; aborting Error:Error converting bytecode to dex: Cause: Dex cannot parse version 52 byte code.…
-
0
votes0
answers47
viewsHow to create an object through a String?
Suppose I have the following object: public class ItemDePedido { private int qtde; private double subtotal; private Produto produto; } In memory this object (already created) is interpreted as :…
javaasked 6 years, 1 month ago teofilooooo 21 -
0
votes0
answers141
viewsRun youtube videos in a web view
Youtube videos do not play in A web view on Android 4.0, but in 6.0 videos run normally. I’ve done a lot of research on this topic, but I haven’t found any practical answers to my very low knowledge…
-
0
votes1
answer196
viewsSending of Websocket file
I need to create a chat channel for a system, this channel should allow to receive and send files(Docs, xls, png, etc...), I searched a lot on the internet and I did not find many examples, but I…
-
0
votes1
answer63
viewsHow can I make my code with fewer lines?
I currently have a large number of lines in my code: Below is the insertion part of players, these players will have the names searched from the bank and sent by cmb box. private void Verificar() {…
-
0
votes1
answer700
viewsHow can I get an Entitymanager from an org.hibernate.Session
I work with Hibernate using Session. public class HibernateUtil { private static final SessionFactory sessionFactory = buildSessionFactory(); // A SessionFactory is set up once for an application…
-
0
votes1
answer844
viewsSet path to save files to Linux
I have a Back-end done in Java where I get some files from the front and save them to a folder. This system ran on a server Windows with Tomcat but recently the same had to be migrated to Debian. In…
-
0
votes1
answer112
viewsSystem is only in load - Tomcat 9 - Eclipse
The system loads only the first screen, no other page loads, it is only in the loading. Obs: When I try to debug the code, it doesn’t reach the breakpoint. By stopping the Tomcat server, the…
-
0
votes1
answer98
viewsI want to compile the java but I can’t
Already installed the JDK, JRE, put td q had to put in the path. javac is working but when I give the "java Helloworld" command the following error is displayed: "Error: Could not find or load the…
javaasked 6 years ago libna rodrigues 21 -
0
votes1
answer37
viewsJlabel of visual bug when use setBackground()
When I use JLabel.setBackground(Color); it simply gives a visual bug. Layout: quarto1 = new JPanel(); quarto1.setBounds(10, 11, 158, 82); frame.getContentPane().add(quarto1);…
javaasked 8 years, 2 months ago Lucas Caresia 2,663 -
0
votes1
answer177
viewsProblem displaying results in java label
package cursoemvideo; /** * * @author DANIEL */ public class TelaCalculadora extends javax.swing.JFrame { /** * Creates new form TelaCalculadora */ public TelaCalculadora() { initComponents();…
-
0
votes1
answer2884
viewsHow to do Spring Boot unit test insert data into Database?
I created a simple system that is working perfectly, but I need to implement a unit test in Spring Boot, which happens that when I perform the test or I cannot enter the data in the database or…
-
0
votes2
answers302
viewsHow to create new Textviews inside a Java scrollview in android studio?
Hi, I have a question to make an app: I need to create a new Textview within a Scrollview at each click of a button. I still need to put attributes to the textview, such as its placement on the…
-
0
votes0
answers59
viewsVraptor (Method with URL connection)
Good afternoon, I am trying to execute a code in Vraptor, that when running my route, I need the system to trigger a connection using URL to a page and return the body. This is a method of my…
-
0
votes1
answer13
viewsPage position on Webviewer Android
Someone can tell me if I have how to set a position of a web page at the time of starting the App that has a Webviewer, example when opening the page it shows initially from the middle.
-
0
votes1
answer413
viewsComplexity function
I’m having doubts about how to perform a complexity function analysis of this Java code package exercicio_2_ed; public class Potencias { public void calcular( int[] numeros ){ for( int i = 0; i <…
javaasked 6 years ago Vinnicius Gomes 115 -
0
votes1
answer293
viewsHow to create the Docker file from a Maven java SE program?
I actually wrote a Java SE Maven application using netbeans and made a CRUD for some entities that are scanned in the database through JPA. I was wondering if it is possible to run a textual…
-
0
votes1
answer182
viewsCall Servlet in a popup
Good morning, you guys... How can I run a Servlet opening in a popup and passing 1 parameter ? My code is like this : - On the page called <form name="frmcadentidade" method="get"…
-
0
votes1
answer35
viewsMake the Mediastore.INTENT_ACTION_STILL_IMAGE_CAMERA put the photo in an image view
I needed to open the Android Camera App and take the photo. When having the photo taken, put it in an imageview. My problem is, the client wants to be able to take the photo or else choose from the…
-
0
votes1
answer57
viewsProblem with TIMER insertion in Mysql table using JDBC
Personal talk! I have the following problem and I am looking for the best possible solution. The following code when running a time is saved in the tAtual (current time) string and sent to the…
-
0
votes1
answer395
viewsValidate log data (spring-boot + Angularjs)
Hello, I am implementing a web project in spring boot + data + Angularjs. Where the client makes Rest requests to the server. On the Spring side I’m using repositories to develop database research…
-
0
votes1
answer590
viewsError generating jasper reports
Then the program to which I am responsible generates reports from files. Jasper and no . jrxml, I went to open one of these files (with Jaspersoft studio) to accomplish what would be a simple…
-
0
votes1
answer83
views404 - Java EE Maven Project with Spring returns 404
I am having problems with the Spring configuration of my Maven project, in which to test if everything was working, a simple hello world did not work and apparently there are no explicit errors,…
-
0
votes1
answer284
viewsHow to read return of a java function
I use a third-party Ged platform that provides web-services JAX-WS. There is a method called `getInstanceCardData that returns the value of the form record fields of a request. Follows the signature…
-
0
votes0
answers48
viewsI need to open the first link of a youtube search in a webview
The webview will not be visible, so the goal is to automatically open the first video of the search. I believe it is not too complicated in JS. code: public class FXMLDocumentController implements…
-
0
votes1
answer1183
viewsCreate a *.csv file with found data from a file
I am developing a project that extracted information from a *.pdf file, was saving this information in a *.txt file, but now I was asked that this information be saved in the format of a…
-
0
votes1
answer50
viewsGet the time on from an Excell spreadsheet
I am using the POI api in Java. To get the time in an excel spreadsheet. In the Excell worksheet the given is as text image: public void obterHora(){ Cell hora = row.getCell(7);…
-
0
votes1
answer248
viewsKeyword 'final' for java variables
The ultimate java keyword for variables means it will only receive one value once, right? If I have several variables in a function and I know that they should not receive any value later it is good…
-
0
votes1
answer277
viewsRead.xml file on an FTP
I’m having a problem reading an.xml file on an FTP, and it displays the following message :"ftp: cifensa.com.br Archivesmaxdata_venda_209016.XML notes (The syntax of the file name, directory name or…
-
0
votes1
answer265
viewsProblem with the confirmDialog component of the primefaces
In the view of my java application I have a commandButton that should open an exclusion dialog, however, when clicking the delete button the dialog is not shown. The code is: <ui:composition…
-
0
votes0
answers35
viewsDoes Viewpager change the way a method works?
I created an app that gives the value of X and Y in a two-variable linear system. Using these (https://www.youtube.com/watch?v=CnlwBwMiFQw and https://www.youtube.com/watch?v=faegDgN7wX4) tutorials,…
-
0
votes1
answer139
viewsNullpointerexception error when calling a method
public void addFormaPagamento() { btnAdd.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { boolean isInsertForma = dbApp.insertFormaPagamento(…
-
0
votes1
answer268
viewsArraylist of Objects + Inheritance
All right guys I’m having a doubt about inheritance, for example: List<Carros> carros = new ArrayList<>(); Chevete chevete = new Chevete(); chevete.acelerarMuito(); //Até aqui ok…