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
-
-3
votes1
answer323
viewsJava - Java security-locked application
I am developing a Javafx application using Intellij, when running in the ide everything goes very well, but when opening the file. JNLP I come across the following message: I am using java 8 for the…
-
-3
votes1
answer337
viewsError creating bean named 'springSecurityFilterChain'
I am trying to use Spring Security, but the following error is occurring: GRAVE: Exception to sending context event started for instance System class…
-
-3
votes1
answer43
viewsHibernate mapping error
Good afternoon person, could help me in a mapping error? Event class: @Entity @Table(name = "EVENT") public class Event { private static final long serialVersionUID = 1L; @Id…
-
-3
votes2
answers61
viewsIs there any way similar to the python . format method for VBA in Excel?
In python using the . format for this: users = ['profile1', 'profile2'] print("www.instagram.com/f{users[0]}/") Would soon come out: www.instagram.com/profile1/ Is there any similar method in vba?…
-
-3
votes0
answers27
viewsProgram using for, ask the user to insert an N number and show on the screen all odd numbers up to N
package br.com.DoWhileAugusto; import java.util.Scanner; public class DoWhileAugusto { public static void main(String[] args) { Scanner entraResposta= new Scanner (System.in); int resposta; int…
javaasked 3 years, 3 months ago Augusto Rodrigues 1 -
-3
votes0
answers20
viewsI need help am starting as android developer
Could someone help me with some questions about the programming area?
-
-3
votes1
answer745
viewsI’m not getting a unit test
I have a problem to do a test method in this JAVA program. The method I devised was to verify that the wolf is dead. @Test public void verificaSeOLoboMorreAposCompletarAIdade(){ campo = new…
-
-3
votes1
answer86
viewsRegister with Tabs
Gentlemen I am making a registration and I chose to do using Tabs because the same is extensive ( many fields ) and involves photos, this way I can put organized information, is the registration of…
-
-3
votes2
answers522
viewsHow to query a bank from a thread?
A teacher asked to develop a project (a CRUD of cars). I’ve done the part of inserting, removing, listing and changing. But the listing part should be done by a thread (teacher requirement), in…
-
-3
votes1
answer407
viewsSend sms with modem 3g
I am developing a java application that sends sms via a modem using RXTX. So far I have this code: public static void main(String args[]) throws Exception{ BlockingQueue<String> queue = new…
-
-3
votes2
answers275
viewsFind patterns within a String
I’m having trouble finding two patterns inside a java string, given a string. For example: String str =…
-
-3
votes1
answer650
viewsSimple Problem (Java Calculator - Switch)
Guys I’m in a lot of trouble for a job to be delivered tomorrow, someone can help ? EDIT: I made the base, but I’m having trouble adding the switch to the code and completing the calculator, can you…
-
-3
votes1
answer163
viewsPostgresql error: org.postgresql.util.Psqlexception: ERROR: portal "C_70" does not exist
We use a Java Web application with Postgres database to generate the Sped files and in the middle of the TXT file generation we are getting the error below. That one portal "C_70" does not…
-
-3
votes1
answer78
viewsComparison of java array
I was doing a project and I needed the following logic... https://www.devmedia.com.br/multiplos-resultsets-em-java/21152 and I came across the following situation... and if it were with two separate…
-
-3
votes1
answer60
viewsRequest access data when some data is wrong
Someone could inform me a way to do the following thing: After the password or user error, or both, the user returned to the first question, in case: "Which user?" so I could try again. package…
javaasked 6 years, 6 months ago Yuri Sanford 9 -
-3
votes1
answer78
viewsMethod is running 3 times
I created this method for a validation when the user will type the option that appears on the screen: private int menu; private int menuImprimir; public int getMenu() { return menu; } public void…
-
-3
votes2
answers112
viewsProblem when trying to add an array of objects within another java array
Hello I have a list of Notes objects and need to save them in xml files. I am trying to convert this list to arrays to add them to the xml file. However I am not able to do the conversion correctly,…
-
-3
votes1
answer213
viewsJava Attempt to invoke virtual method error 'android.view.Window$Callback android.view.Window.getCallback()' on a null Object Reference
Folks need a help with an error in a method of my code. Basically I have a Framelayout that loads two Fragments. When starting the APP it loads the first Fragment with 3 Textedits and a button. When…
-
-3
votes1
answer44
viewsSearch in java file
The teacher passed an activity, which is for you to put the files in a txt, read, change and delete... I am programming the search function, and it is not working. You could help me? public void…
-
-3
votes1
answer192
viewsException in thread "main" java.lang.Illegalargumentexception: Type without superclass: module-info
I created a game with libgdX and runs normally on mobile emulator, but now to generate the key apk it does not generate, I’m wasting a little time with it, someone knows the solution ? Exception in…
-
-3
votes1
answer105
viewsNo suitable driver found Mariadb
I am trying to insert a tuple of data into a DB using JDBC through a web page. I took a class ConnectionFactory to encapsulate the connection with Mariadb, I imported the driver to the classpath,…
-
-3
votes1
answer84
viewsERROR 500 - But I don’t know where is wrong, someone help me!
@PostMapping//Create public ResponseEntity<Categoria> criar(@RequestBody Categoria categoria, HttpServletResponse response) { Categoria categoriaSalva = categoriaRepository.save(categoria);…
-
-3
votes1
answer74
viewsReport in IREPORT - STATUS
Good morning , I need to change a report in IREPORT that works today as well: Currently the field works like this: (Boolean) $F{documentoVigente} ? "VIGENTE" : "VENCIDO" I have a text called…
-
-3
votes1
answer204
viewsDetect digit repetition in Java
I need to make a program that reads a positive integer N. After reading this number, the program must evaluate if there are repeated digits in the number. For example: in 234571 there are no…
-
-3
votes1
answer110
viewsHow to generate a qrCode from a url
url = https://staging.coinwise.io/api/invoice/v1/invoice/koy-intel-juridica/default-btc?value=0.05 Json:…
-
-3
votes1
answer223
viewsAccess toString method from generic class
I have a generic class Official and other 3 specific classes that inherit from employee. Within the Employee class, I have the method toString. abstract class Funcionario { private String nome;…
-
-3
votes1
answer35
viewsWhen I run my program this error appears and I don’t know what is wrong
public class ClasseExecutoraFuncionarios { public static void main(String[] args) { List<Funcionario> funcionarios = new ArrayList<>(); Scanner entrada = new Scanner(System.in); Scanner…
-
-3
votes1
answer123
viewsLogical Problem Bubblesort Sorting Method
I am sorting numbers from a CSV file. I import the numbers and step into an Array List and convert the ArrayList<String> for ArrayList<Integer>. It turns out I’m having a little logic…
-
-3
votes1
answer207
viewsProcess form data with javascript and html
I wanted to make a program that the user would send 3 notes and after pressing "Calculate", you would be redirected to a page that would appear your average. Who could help me: function calcular() {…
-
-3
votes1
answer144
viewsProblems creating executable jar with Jlayer library in Intellij
Good afternoon guys. Here comes my question: I am creating a simple java 8 desktop application with swing in Intellij. At the end of some modifications I was creating a .jar executable and up to…
-
-3
votes2
answers936
viewsjava login screen and Mysql database
I am validating the login of a simple system but giving an error does not login I will send you the code of the class and the moment I try to log in. Lojabd class that validates the user class that…
-
-3
votes1
answer98
viewsError: Exception in thread "main" java.lang.Nullpointerexception
I have to do this exercise but at the time of error executing. Please help me. Code 1: public class Correntista { private String cpfCliente; // cpf do correntista private float saldo; // saldo da…
javaasked 5 years, 6 months ago Thallis André 1 -
-3
votes1
answer37
viewsProblems with Nullpointerexception in a class
I have this code below that throws me the exception of NullPointerException. Besides, oddly enough he’s not "printing" anything,? import java.io.BufferedReader; import java.io.File; import…
-
-3
votes1
answer80
viewsDoubt with Bubble Sort
package AlgoritmosII; import javax.swing.*; public class Exercicio //BubbleSort { public static void main(String args[]) { int troca, fim, i, aux, k; int tamanho =…
-
-3
votes2
answers1544
viewsHow to insert a LI into a UL with Javascript?
I’m looking to add a LI between two LI’s of a UL. I don’t have access to the CSS/HTML code of the website template, if it would not create easily, so I’m thinking about adding via html and…
-
-3
votes2
answers99
viewsWhy can’t I print according to the state?
public class Lampada { private boolean ligada = true; /* * Métodos acessores e modificadores */ public void setLigada(boolean alteraEstado) { this.ligada = alteraEstado; } public boolean isLigada()…
javaasked 5 years, 1 month ago user165972 -
-3
votes1
answer123
viewsImplementation of the Java Mysql MVC model
In my model I am accessing Clientedo by the controller of my model Customer as seen in the example below. I would like to know if this practice is correct for the mvc model, since both classes…
-
-3
votes1
answer200
viewsHow to open "Save As" in a Java application?
I am trying to create an application that takes a user input stores in a variable and saves the input in a directory informed by it through the "save as" windows, but I can only access the file…
-
-3
votes1
answer1194
viewsRequirements check failed for JDK 8 ('1.8.*')! Detected version: 13.0.2
Please help me out! I don’t know what else to do... I’ve read all the help that talks about it and so far I haven’t been able to solve it! Tiagos-iMac:app Tiago$ Cordova run android Checking Java…
-
-3
votes1
answer63
viewsNew machine and eclipse installation, Maven and all java project
I installed the eclipse. Java Maven I downloaded the project when I go on the option Maven clean, gives the error: [INFO] Scanning for projects... Downloading:…
-
-3
votes2
answers98
viewshow to leave the result 93.1
When rotating the following code: package Aula_4; import java.util.Scanner; public class Exercício_3 { public static void main(String[] args) { Scanner entrada = new Scanner(System.in); float…
-
-3
votes1
answer55
viewsJenkins with Spring Boot = Exceptioniitializererror
I have an application developed with spring-boot. If I manually call the jar generated via Maven by the java -jar command, the application starts normally, and we can use it here. However, to…
-
-3
votes1
answer100
viewsLoad modal only once
I have a modal that is loaded after login (automatic), but at each refresh the modal opens, I need it to open only once after logging in. <rich:modalPanel id="modal" autosized="true" width="500"…
-
-3
votes1
answer185
viewsHow to remove Tableview lines even with search field using Javafx?
Eae personal, I am trying to put the option to clear Tableview in my project, but as I have implemented the search option whenever I try to clear Tableview is presented this error: Exception in…
-
-3
votes1
answer970
viewsError with Hikaripool-1 spring
I have this error when I try to initialize my spring project. I can’t find anything to make it work. . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \…
-
-3
votes1
answer58
viewsmy Boolean does not respond , what should I do?
my code is public class Game extends Canvas implements Runnable,KeyListener{ private static final long serialVersionUID = 1L; public static JFrame frame; private Thread thread; private boolean…
-
-3
votes1
answer526
viewsHow to take a variable within a method of another class
Good evening, I’m starting to learn Java and I came across this problem and I need help. I want to call a variable for my Main, only it is within a method. I’ve tried using player.Pawn(), but this…
javaasked 4 years, 4 months ago Tired Programmer 5 -
-3
votes2
answers1946
viewsConverting a String to Localdate
I was taking a date in a jLabel in the format dd/MM/yyyy and trying to convert it to Localdate and then use it with Localdate methods, but I ran into some errors and found nothing on the internet…
-
-3
votes1
answer98
viewsHow to use an Alert without giving Refresh on the Page?
So, I’m doing a client registration with Java web (jsp) and Servlet, where I receive in my registration database the form data and check if there is already Cpf. The code goes right down. try {…
-
-3
votes1
answer27
viewsProblem when trying to make a constant subtraction in Android Studio
I wanted to create a very simple game in which consists of pressing a button, after that the program would give two random numbers and the life of each character would fall according to this number,…