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
-
1
votes0
answers31
viewsliquibase:diff always generates indexes
I am using spring-boot with the liquibase-Maven-plugin plugin to generate database changes according to my classes, but the command "mvn Compile liquibase:diff" always generates removals and…
-
1
votes1
answer242
viewsWebview - Update option appears only once in onReceivedError, see more
Hi, I’m developing a project for my site, and until then it’s getting really cool. Only I had a little problem and it’s like this, whenever the page gives error I called Feature Snackbar, getting…
-
1
votes1
answer769
viewsHow to decrypt encrypted email in SHA-256?
I’m encrypting an email and saving it in the bank, how do I decrypt that same encrypted email. Follow the code I used to encrypt. public String getEmailCriptografado(String email){ email =…
-
1
votes1
answer73
viewsTables not being generated - Hibernate
I have 2 tables of my software that are not being generated correctly. SQL is generated, but when checking in Mysql, not the encounters. If I change the tag to: <property…
-
1
votes1
answer36
viewsDeleting a Watcher’s subfolder ends the loop
My code is this:: try { watcher = FileSystems.getDefault().newWatchService(); registerAll(path); } catch (IOException e) { return; } while (true){ WatchKey key; try { key = watcher.take(); } catch…
javaasked 8 years, 9 months ago Rodrigo Santiago 1,822 -
1
votes2
answers590
viewsSeparating Sentences in a String
I have this String with a space between the title (uppercase) and the description: THE CASE BACK TO DISTRIBUTOR Drop again The code: final String linha =…
-
1
votes1
answer34
viewsSet CLASSPATH to be accessible in Apache
How do I for the environment variable CLASSPATH be accessible by apache? I have a Django project that uses the library python-weka-wrapper that bridges the Weka Java implementation. Everything works…
-
1
votes1
answer213
viewsMethod imageView.getDrawable() launches Nullpointerexception
I wanted to take Imageview’s drawable and convert it to a bitmap. The conversion method I already have and is working well however, when I request the execution, it presents the following error:…
-
1
votes2
answers990
viewsRemove data from within a String
In java I am reading several lines of an HTML file and in it I have to remove some data and store in variables. And to remove this data I have to remove some tags and data that are within certain…
-
1
votes1
answer93
viewsTurning UTC milliseconds into other Time Zone
I receive from a service the date in milliseconds and UTC. I need to turn into the User Time Zone. For that I did the following: public static void main(String[] args) { // Milisegundos está em…
javaasked 8 years, 9 months ago Thiago Luiz Domacoski 7,310 -
1
votes1
answer1902
viewsI can’t get Joptionpane on Eclipse
Guys, I can’t seem to call JOptionPane in no eclipse class, tried in Netbeans, and ran normal. Someone there may know what might be? Error message: Multiple markers at this line - Access…
-
1
votes0
answers1248
viewsHow to capture webcam images in Opencv in Java?
Hello, I’m a beginner in opencv with java, and my problem is this, I want to capture the real-time image of my webcam and stream it on a Jlabel, but I’m having a problem running the file, netbeans…
-
1
votes0
answers267
viewsJasperreport dependencies error
I use Netbeans. In my Maven I have this dependency for Jasperreport: <dependency> <groupId>net.sf.jasperreports</groupId> <artifactId>jasperreports</artifactId>…
javaasked 8 years, 8 months ago Rodrigo Lima 315 -
1
votes0
answers459
viewsandroid studio: AVD Nexus_5 is already running
I cannot run the AVD because the message appears below: I tried to delete the folder below: Someone knows what I must do?…
-
1
votes2
answers100
viewsDo you need to use Appcompat and Support Design libraries when the minimum API is 21?
I recently updated an application I am developing to use minimum API 21 (Lollipop), before it was on 19 (Kitkat). In the case of Kitkat I needed to use Appcompat and Support Design to take advantage…
-
1
votes1
answer521
viewsgetOutputStream() error has already been called for this Response
I have in my application the following error: getOutputStream() has already been called for this Response. Ok, the chunk of code that is causing this error is as follows: boolean hasLogoLogin = new…
-
1
votes2
answers3290
viewsCapitalize the first letter of each word
I want to standardize what the user typed in edittext by capitalizing the first letter of each word and the rest lower case. How do I do this? The part that arrow the variables in the model class…
-
1
votes1
answer423
viewsHow can I persist data using Arraylist?
I need my Arraylist data structure to be visible in more than one method of my Products class. This is how I’m working: package estoque; import java.awt.Component; import javax.swing.JOptionPane;…
-
1
votes3
answers80
viewsDoubt about instructions that can be implemented in Hibernate
Technical Course Test Question of Java Programming Language: What instructions can be used in Hibernate? a- JDBC b- JPA c-SQL d- JNDI…
-
1
votes2
answers951
viewsHow to pass variable by parameter created in Enum in Java?
I created a Class enum of java public enum Cor { AZUL(1),VERMELHO(2),VERDE(3); private int var; Cor(int var) { this.var = var; } } In the main I’ll create a menu using do/while and switch/case and…
-
1
votes2
answers5419
viewsFormat Date yyyy-mm-ddTHH:mm:ssZ to dd/MM/yyyy HH:mm
I receive in JSON a date field "created_at": "2013-01-08T20:11:48Z" and wanted to present on the screen in the formed of Brazil but I can’t use Simpledateformat to format and present in any way.…
-
1
votes1
answer41
viewsData search and comparison
I need to carry out a search and I wrote the following code to carry it out, but without success. I wonder if I’m doing it properly. public void AcessoCC() { int id = 0; Integer infoConta;…
-
1
votes3
answers1406
viewsHow to change a value of a variable inside an if in java?
I created an abstract class called Player and also created the player subclasses. Now I need to create a menu for the user to choose which character he will use in the battle, but I can’t create a…
javaasked 8 years, 8 months ago Saulo Victor 13 -
1
votes0
answers34
viewsOverride in Java assignments
What is override for in java assignments?? Example : I am assigning values in a certain class of the package I created in netbeans. But there’s a slide that after all the assignments made to the…
javaasked 7 years, 2 months ago Bruno FiCherry 11 -
1
votes1
answer1259
viewsHow does Camelcase work? Where do I use upper and lower case names?
I didn’t quite understand the concept of naming with uppercase and minuscule letters. I know which classes should be named with the first capital letters (Camelcase), but and objects, variables, and…
-
1
votes1
answer65
viewsDoubt about Hibernate Criteria
I am trying to make a system for service order just for me to train. In the service orders I can have several categories. And my doubt is time to display, for example, a ranking of the most used…
-
1
votes1
answer205
viewsError making a GET, Javascript, Angular, Spring, Java request
I have an error opening the screen with the bank search results. error is in image below. Debugging, the data is coming from the database. In the other image, the server log appears My class…
-
1
votes1
answer80
viewsTime consumption in cubic code
I need to calculate the time consumption of the following algorithm: int somaSequencial(int v[],int n){ int m = 0; for(int i = 0; i < n; i++){ for(int j = i; j < n; j++){ int s = 0; for(int k…
-
1
votes2
answers1757
viewsFXML file stopped opening with Scene Builder
Until yesterday when I was moving opened a good file. Then now does not open my file anymore. The other fxml of the project open normally but this one in specific appears the icon below that is open…
-
1
votes2
answers53
viewsLoop counter is not incrementing
I’m having a hard time finding the error in a logic that I use for traversing an arraylist. List<Caneta> canetas = new ArrayList<>(); canetas.add(c1); canetas.add(c2);…
-
1
votes1
answer177
viewsMaven Spring MVC + JPA Project
I’m new to Spring MVC, created an example Maven project for Spring MVC using Hibernate and JPA. I found some problems when configuring persistence.xml but I could not use dartasource managed by…
-
1
votes1
answer649
viewsE/Sqlitelog error: (1) in such column
I’m getting a bug in my code and I can’t seem to fix it, I wonder if you could give me a little help? I’m getting the bug "E/Sqlitelog: (1) in such column": 09-27 04:04:14.798…
-
1
votes0
answers74
viewsExtends and super difference - Generics Java 7
I would like to know the difference of super e extends when declaring something Eneric in java, let’s go to the code that is easier. class Pai { } class Filho extends Pai { } class Filha extends Pai…
-
1
votes1
answer41
viewsHow do I set a list of images in the listview -> imageview from the page url?
The problem is that whenever you have a new image on the specific page I have to update the application with the new URL of the image set on the page.
-
1
votes3
answers89
viewsRedo the method instruction
I would like to know how I do to redo the instruction of a method until the user cancels. I have the following method, for example: public static void method(){ int i = 1; i += 1; String choise;…
-
1
votes1
answer2246
viewsHow to redirect page in JSF?
I have a system with a form in which you can edit or remove items. In it there is a link to redirect another page. What form it is possible to redirect a JSF page?…
-
1
votes1
answer159
viewsHow to Print Step by Step
I have the following program that does the following, you insert the rules(V,T,P,S), through 1 file and then vc inserts the word(GLUD) to see if it is part or n of the language that is in the rule,…
-
1
votes1
answer56
viewsDisplay 1, 2, 3 if you receive odd numbers
I need that in the textview displays in order 1, 2, 3, 4 etc. But the value it receives from dados.getdia() is always 3, 5, 7, 9, 11 etc. I have tried several things. In this code below it works up…
-
1
votes0
answers144
viewsHow to reverse positions
I am doing a work of LFA (formal languages and automata), which recognizes GLUD languages only that now I would like to make it recognize GLUE languages, which would basically just change the…
-
1
votes0
answers106
viewsHow to Start Arduino Serial Communication with Raspberry PI 3
I am making a little project on the Arduino and need to start the Serial communication with the Raspberry PI 3 without IDE with the S.O Raspbian Lite. That is, the Raspbian Lite has no graphical…
-
1
votes1
answer164
viewsUnexpected return when converting String to Integer in Java
I have a java code in which you receive engine speed data. In java with I get a String I need to convert to integer to make a comparison to know if the engine started or not. When I get the string I…
-
1
votes2
answers903
viewsHow to receive by parameter an array of objects of another class in Java?
Hello people my question is that I am trying to receive by parameter an array of objects of another class,for the class I want to put the array by parameter. Classes are : Route and Costs I have to…
-
1
votes1
answer282
viewsUse Sublime Text with Eclipse
I’m in a new project that uses the Java WEB + Spring in the backend and I do only front-end. I need to keep Eclipse open to run the server. However, I use the Sublime Text 2 in html editing because…
-
1
votes2
answers590
viewsA person can have multiple phones. How to do this with vector and not with list?
I’m having trouble connecting Telefone with class Pessoa, a person can have up to three phones. How does this? package model; public class Pessoa { private String nome; private String endereco;…
-
1
votes0
answers304
viewsValidation of Jdatechooser
I need to validate three dates that are like JDateChooser. These dates are: date of birth, date of admission and date of dismissal. The date of birth may not be longer than the date of admission or…
-
1
votes1
answer3495
viewsUpdate Jtable after each data change in a cell
I’m using java swing where I have a window and in it a JTable. I run a method where you will read the data from this Jtable and update a column, cell by cell, of this Jtable. The problem is that it…
-
1
votes2
answers559
viewsCapture Textfield change from Javafx
Have some event that captures every change that occurs in a Javafx Textfield?
-
1
votes1
answer1074
views2 files properties on Spring Boot
I am developing an API with Spring Boot, and I have 2 properties files for the development and production environments, How do I set the properties file of certain environment?
-
1
votes1
answer281
viewsI can’t save in the bank and does not show error log in Hibernate project
In the project I use hibernate, and when I try to save a new client, it just shows the class validation message CadastroClienteService. The strange thing is that all fields are filled in the form,…
-
1
votes1
answer143
viewsI’m having trouble connecting SQL with java
Well... I did some classes, and it was time to connect to search for a data in the bank; Ok. He had already connected with the BD, however, when I did the class to fetch the data, he keeps giving…