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
votes0
answers87
viewsSpringboot error while returning JSON
I am using Spring Boot on my API. Spring has the ability to convert Javabeans automatically to Jsons when returning an object. However, with this code (in my MODEL layer) I am having a…
-
0
votes2
answers261
viewsHow do P:Izard go back to a certain tab?
I have a p:Wizard in which, if a certain condition is true, it advances to the last tab by clicking next. But I’m not getting it back to the first tab if I click back. There’s a way to do this with…
-
0
votes0
answers55
viewsDynamically obtain jboss.server.data.dir "Operty"
I’m trying to test with junit in order to test if a directory can be created in the filesystem, to be able to test in all environments need to get the jboss 5.1 path dynamically via…
-
0
votes1
answer544
viewsWhat’s the Actionlistener for?
I’m starting to study Java. Can someone explain to me, in detail, in the most complete and simple way possible, what good is the method actionListener java (da lib swing). 'Cause I’m having a little…
-
0
votes2
answers4974
viewsPrint larger number of an array
I have a program where I read 3 values and store in an array, but I would like to print the highest value of this array. Follow my code below: public static void main(String[] args) { Scanner input…
javaasked 5 years, 2 months ago user143767 -
0
votes1
answer481
viewsHow to create an event for a button in Swing/Java
Guys, I wanted to ask a favor, I wanted someone to show me how to create an event of a Jbutton, like, a q button when you click on it it opens another Jframe and closes the old one use this code as…
-
0
votes1
answer191
viewsReturn AD physicalDeliveryOfficeName using LDAP with Java
I’m creating a Java application that integrates with active directory. But I’m having trouble returning a specific data: the Office field (Office - physicalDeliveryOfficeName). Theoretically, his…
-
0
votes0
answers411
viewsJava Beginner Doubt - Why is the result of the double variable wrong?
I made an algorithm that simulates a bank account, where the client can withdraw and deposit values, worked perfectly when I used variables like int, but when I use double type variables (in order…
-
0
votes1
answer113
viewsJavafx application with icone on the Tray system
I am creating a Javafx application to perform queries in a database and save XML files. The application will run full-time on the machine that is in operation. The application has a visual interface…
-
0
votes3
answers843
viewsSoap Request 403 Forbidden
Hello folks please I need your help. I’m trying to send make the connection to the esocial api but I got the 403 return Forbidden, I’m with updated certificate and using jks. Below is the section…
-
0
votes2
answers1226
viewsHow to run a JAR with a specific JRE?
I have Java 7, 8 and 9 installed on the same machine and I want to make my program run using Java 7, how do you do it on? (may be on the command line or not).
javaasked 5 years, 1 month ago Michael Jonathan 1 -
0
votes0
answers650
viewsRequest SOAP with Spring using A1 certificate
I am trying to make a Request for sending Nfe to the Sefaz SP server, but I am always receiving the certificate error not found. I created a Bean that returns the Webservicetemplate, and this is my…
-
0
votes1
answer22
viewsLoad application package image using File
Good morning, How do I load an image that is inside a project package using the Java File class? Example, I have an image inside the "img" folder of my project and I want to upload this image to…
-
0
votes1
answer348
viewsReceive parameters of different Actions and add
Hello, I need to pass the parameters of two screens to the tela_inicio, be the "BALANCE" parameters of the screen balance where it will be passed to an Edittext (lblSaldoAtual) at tela_inicio and…
-
0
votes1
answer62
viewsHow to prevent me from registering the same movie again
I have this method: test method of the package view location class public int teste(){ String selecao = cbFilmes.getSelectedItem().toString(); String[] campos_filmes = selecao.replace("…
-
0
votes2
answers61
viewsCould you help me because you won’t remove it from the list?
My interface public interface RepositoryProdutos { public void Listartodos(Produtos produtos); public void Salvar(Produtos produtos); public void remover(Produtos produtos); } Class implementing…
javaasked 7 years, 11 months ago Everson Souza de Araujo 359 -
0
votes1
answer206
viewsorg.springframework.Beans.Invalidpropertyexception: Invalid Property
I am new in the java world I am with the springframework error when trying to send a request via ajax. Does anyone have any idea what might be causing the error? Below an example: Javascrpit: var…
-
0
votes2
answers89
viewsProblems when adding numbers to an Arraylist
My code is like this: public class QuestionarioController implements Initializable { InicioController inicio = new InicioController(); Quiz questionario = new Quiz(); @FXML private Label…
-
0
votes1
answer507
viewsJava spring + Thymeleaf showing "Whitelabel Error Page"
I am following a tutorial, however when starting my application it does not open the index page but an error page: Someone could help me? Application start class: package com.userFront; import…
-
0
votes1
answer43
viewsthe serialVersionUID of has to be the same in all classes "Serializable"?
I already have some notion about the serialVersionUID representing the class version (in bytes form) very objectively. But the version number can or should be the same in different classes ?
-
0
votes1
answer134
viewsCan I use JSON to save Arraylists in Shared Preferences?
I’m developing an app on a college project and I’m creating the control part, I won’t mess with the server part for now because I don’t know much about. I’m creating functions to generate some…
-
0
votes2
answers1497
viewsHow to remove decimal point
I have this method public void calcularVotosTotal(){ System.out.println("votos valiudos " + this.getNumeroEleitores() * 0.8 + "% " + " Votos Brancos " + this.getNumeroEleitores() * 0.06 + "% " + "…
javaasked 7 years, 11 months ago Everson Souza de Araujo 359 -
0
votes1
answer1429
viewsSpring Boot - Error java.lang.Illegalargumentexception: Not an Managed type
I’m having a mistake in Spring and I’m not getting a very good understanding of what’s going on, could you help me? LOG 09:25:43.038 [main] ERROR o.s.boot.SpringApplication - Application startup…
-
0
votes0
answers168
viewsClick on a field with multiple Selenium results
In my test script, I’m doing a system search that brings me 4 results. I need to make a method that selects only a specific result (in my case the 4th). I tried it this way, but it didn’t work.…
-
0
votes2
answers284
viewsHow do I scan a Date type data?
I want to read like this, but you don’t have the option I want; public class Cliente { Date dataNascimento; } Scanner e = new Scanner(System.in); cliente.setDataNascimento(e.next); I did it but it…
javaasked 5 years ago Valdecir Junior 19 -
0
votes0
answers33
viewsWhen should I create Enums and Interfaces?
I am a beginner in programming and would like someone to help me.
javaasked 5 years ago Gabriel Sousa 9 -
0
votes2
answers232
viewsproblem with java.lang.Nullpointerexception
Well, I’m trying to popular a Jtable with database data, but I have always found the same java.lang.Nullpointerexception Exception. It should work as follows: user clicks the update button and the…
-
0
votes1
answer1565
viewsSpring Boot - Changing object property names when returning JSON from the API
Good night to you guys! I have a Rest api created with spring boot + Hibernate and all that is right! Let’s imagine the following scenario: The data engineer created the database as follows…
-
0
votes1
answer131
viewsModulepath does not appear in the Libraries tab of my Eclipse, how can I configure it?
I was trying to add a library to the module path when creating a project, but I can’t correctly add pq to the modulepath option. I’m following a tutorial. My screen doesn’t appear... And the…
-
0
votes0
answers419
viewsCreate popup window on android?
I created this code here but something is wrong, because every time I click on the button that activates the popup the app closes. //Button private Button pesquisar; private PopupWindow…
-
0
votes1
answer44
viewsHow to load database data to a jtable
At the time of execution appears the error message of this excerpt and I am not able to find the error. I know the connection to the bank is right because I have other classes in the same program…
-
0
votes1
answer186
viewsBigdecimal - set to null by form when input is empty
I have a form (jsf/primefaces) where a value of the kind BigDecimal, can be submitted without value. In this case, its value should be null. However when set is as 0. There is an argument that is…
-
0
votes2
answers475
viewsTry/Catch: java.lang.Outofmemoryerror: Java heap space
I have a very serious problem in my web application, and after a lot of research, I found that the error java.lang.Outofmemoryerror: Java heap space Could be being caused by try/catch with catch…
-
0
votes1
answer67
viewsUsername change in token OAUTH2
I have a Rest API in spring with OAUTH2 my doubt is the following, it is possible to change the username that is written in the token of each session of OAUTH2. My problem basically is, that to…
-
0
votes1
answer69
viewsShould I use Swingutilities.invokeLater if I don’t directly extend Jframe?
Hello. I understand that people use the method invokeLater of SwingUtilities when extending directly the class JFrame and initialize it in the method main. But what if I happen to have one JFrame as…
-
0
votes1
answer52
viewsProblem parsing regular expressions of a jTextArea
I am trying to analyze a text typed in a jTextArea, in the form of an algorithm in English. Initially I must recognize the main method, which is characterized by "beginning" and "end". The way I’m…
-
0
votes1
answer381
viewsWhat is the purpose of operating system variables related to Java?
There are environment variables that Java uses to perform certain actions, such as JAVA_HOME, CLASSPATH, Path, ... Most of the material talking about these variables are confusing, often some…
javaasked 5 years ago NinjaTroll 1,752 -
0
votes1
answer313
viewsJava error: Exception in thread "main" java.lang.Arrayindexoutofboundsexception: 0
I am starting to learn java and in my simple code input arguments in the program is giving the error: Exception in thread "main" java.lang.Arrayindexoutofboundsexception: 0 This is my code: public…
javaasked 5 years ago Gianluca Belhome 3 -
0
votes1
answer169
viewsWhat does it mean to underline this section of the code?
I’m trying to use a searchview along with the listview of my project, but I’m not getting it, because where I’m going to set the lisview Adapter inside the onQueryTextChange method, it appears…
-
0
votes1
answer188
viewsDelete selection from a List
In my java class I created a form and in it I created a button that clears all fields. But I can’t get you to delete the selection of a list that I have in the form, it erases the textfield and…
-
0
votes1
answer812
viewsSpring Boot does not start in Debug (Java) mode
I have an application developed with Springboot and can’t start my application in mode only debug. (If not debug it starts normally) It seems to loop and this error message keeps showing up in the…
-
0
votes2
answers716
viewsConverts String to int Arduino in C
Good people, I will try to explain my problem. I am developing a little software in Netbeans that communicates with Arduino via Serial Port. My problem is that in Netbeans IDE I am sending String,…
-
0
votes0
answers177
viewsLiquibase. sql file not found
When I run liquibase it does not find . slq files configured by tag. Sqlfile. how to solve this? Data from the problem: Design use of liquibase 3.4.2. Configured the Maven plugin Execute script in…
-
0
votes1
answer126
viewsAccess variable inside Inner class
I’m new in android/java programming and then I came up with this error. public class Activity_2 extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) {…
-
0
votes1
answer145
viewsUnusual problem in the Eclipse
Guys I’m starting in the Java programming language, but is giving an unusual error, the lines of code are right but I can not solve, I’ve configured the environment variables (I do not know what…
-
0
votes1
answer37
viewsDoubt with JAVA regular expression
Hello, I have a question about the following case. I’ll give you an example code of how mine is String texto = "111 aaa"; String reg = "\\d+"; Pattern p = Pattern.compile(reg); Matcher m =…
javaasked 5 years ago Weriky Alphazero 37 -
0
votes0
answers72
viewsError compiling app for Android 4 (Program type already present)
I have an Android (Java) project and after migrating to Androidx I received the following error (d8 errors): Program type already present: com.enterprisedt.BaseIOException Note that Gradle…
-
0
votes1
answer296
viewsWhy is it necessary to place public Static void main(String[] args)?
I want to understand the real intention of this command line, what it does ? My teacher didn’t comment about her just started the project with her, in which case I created the code: package exemplo;…
-
0
votes1
answer197
viewsI want to enter a number and it’s multiplied from 1 to 10
package exercicio5; import java.util.*; public class Exercicio5 { public static void main(String[] args) { int i,n1,x; Scanner ler; ler = new Scanner(System.in); for(i=1;i<=10;i++){ x=n1*i;…
-
0
votes1
answer212
viewsInfinite loop in java
This my code aims to rename a mass of files to set the following pattern: All compound names, words must start in uppercase. First I give a substring for names that have only one word and then I…