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
answer22
viewsGEOS support not enable - Java Binding GDAL
I’m trying to create a method that calculates intersection using the lib GDAL, but when calling the intersection method I get the null return with the following message on the console: GEOS support…
-
0
votes1
answer263
viewsError trying to access site using Http Service
Hello, people. I really need your help. There is a system in which I am working at the University that consists of entering the academic system of the university, through the requisition of…
-
0
votes3
answers579
views3 java classes, one calling the other, how to call first-to-last methods? (bluej)
I have 3 classes, they are: rental, cars, and customer. Rental contains cars, and customer contains rental. If I want to, in customer class, call one of the car class methods, how do I do? For…
-
0
votes0
answers109
viewsJava Calendar class
Good afternoon! The need arose to create a class that receives two dates in my activity, to make the code less dirty. I did some research and found the Calendar class, but I didn’t fully understand…
-
0
votes1
answer1006
viewsBug with.google.android.gms in ':app:processDebugGoogleServices'
My code is making that mistake: Error:Execution failed for task ':app:processDebugGoogleServices'. Please fix the version Conflict either by updating the version of the google-services plugin…
-
0
votes0
answers24
viewsLibrary to generate files referring to a class autonomously?
For example I create the dog class there after I have to create the files DOG, DOG, DOG, DOG. I was wondering if there’s a way to automate this, just creating the class and then these other files…
-
0
votes1
answer73
viewsPrimary Key: Hashmap or Common Object?
Good afternoon guys, all right? My question is this... I want to use Hashmap as the primary key. Is there a problem? Or should I use Object? NOTE: I am modeling the database, which will be with…
-
0
votes1
answer39
viewsReactjs doubt about nomenclatures
Hello, I am studying Reactjs and I have a question regarding the nomenclature of functions. I see in the tutorials and in the post the staff always put: handleClick; handleSend What is this Handle?…
-
0
votes0
answers135
views -
0
votes0
answers19
viewsError when trying to use conditional structure equality in java
The code below is giving error in line if (sexo = 1){, can anyone explain to me why? int sexo = 0, sexoF = 0, sexoM = 0, bom = 0, ruim = 0; while (sexo != -1){ System.out.println("Digite o sexo: ");…
-
0
votes1
answer71
viewsAnnotation @Get does not work in controller
I am trying to customize my url with @Get on Vraptor 4, but it is not recognized, Follow the controller: @Controller public class OlaController { @Inject Result result; @Get("/ola") public void…
-
0
votes1
answer729
viewsHow to convert a string to JSON object
I get in the @FormParam a text in JSON format, I want to know how to make it a JSON object in Java, so I can manipulate the elements? @Produces(MediaType.APPLICATION_JSON) public String…
-
0
votes1
answer228
viewsRegular Expression - Split disregarding anything within parentheses
Can someone help me with a regular Java expression that separates the text by . (point) disregarding what is within the parentheses. For example: abacaxi.laranja.(pera.banana)limao.mamao You have to…
-
0
votes1
answer80
viewsReturn a value from a MYSQL/JAVA column
I have the following code to store the maximum value of a column in a variable integer codemax: cf = new ConnectionFactory().getConexao(); int codigomax = 0; try { stmt1 =…
-
0
votes1
answer408
viewsHow to Design Spring Boot?
I am doing a Spring Boot course but I believe I am versioning incorrectly, because I can not run the application after giving a git clone. I’m used to the versioning of Angular and Node, as it is…
-
0
votes1
answer38
viewsGet Selected Index
Good afternoon. I want to set the option of a Jcombobox field as the registered option in a given vector position. For a previous text field, I made the following settings:…
-
0
votes1
answer498
viewsSerialization Localdatetime
I am trying to serialize an object that has a date with the Localdatetime class using Spring Boot, but the following error: 2016-10-09 18:28:26.218 WARN 17395 --- [ XNIO-2 task-2]…
-
0
votes1
answer150
viewsCreate a multidimensional array in Java table format?
I’m a beginner in Java and have doubts how to create Multidimensional Array, I have the table below How do I create a Multidimensional Array from this table?…
-
0
votes1
answer143
viewsFirebase stopped saving to Realtime-database
From yesterday to today, firebase stopped saving any kind of data in the database and I would like to know why. I just yesterday was testing my Whatsapp app clone naturally, but without changing…
-
0
votes3
answers97
viewsI cannot save my Selectmanycheckbox Primefaces in the database
My View Cad Medico xhtml <p:selectCheckboxMenu id="multiple" value="#{medicoBeanView.objetoSelecionado.especialidades}" label="Especialidades" multiple="true" filter="true"…
-
0
votes1
answer39
viewsProblem running Java Web project
someone has already had this same error using Javaweb ? I can’t run my project…
-
0
votes3
answers355
viewsPrimefaces Datatable Edit does not send updated value for editing
I am trying to update through the Edit datatable of the first faces, but it does not send the updated inputtext value to the bean. The process occurs almost correctly, the value is sent and updated,…
-
0
votes0
answers142
viewsSQL server connection with android application
How to connect an android application to sql server database ?
-
0
votes0
answers106
viewsWhat’s the UPDATE error? (Java with Database)
Hello, I am developing for the first time a system in Java with Database and there is some error in the Update that since yesterday I look for and not found. The error is that when I click to…
-
0
votes0
answers13
viewsHow to instantiate a bean again after the session drops JSF 1.x
Good afternoon, you guys, I’m racking my brain with something I believe is simple. Next, is there any way to instantiate a Bean and its attributes "manually"? I have a configured bean in xml with…
-
0
votes2
answers150
viewsScanner is not reading all the text it receives
I’m creating a program whose idea was to take a text with a few words and break them in ",". Only you are reading only up to a part of the text. Follow the code and text below: public static void…
-
0
votes1
answer233
viewsProblems with Spring Security
Hello, everyone. I am creating a project using Java EE and as an IDE I am using Eclipse. In this project, I am using Spring Security to authenticate the login procedure. Only this happens: I created…
-
0
votes0
answers105
viewsMerge Jasperreport report with other Pdfs and images
I have a Jasperreport and need to attach to it other Pdfs and images that the user attached. I was suggested to use iText, but I still have no idea how to merge the Jasper report pdf with these…
-
0
votes1
answer128
viewsChromedriver on MAC - Eclipse/Intellij
I have the following problem: I am now with MAC and can no longer run my automation. I already downloaded Chrome for MAC, but still get the following error: java.lang.Illegalstateexception: The…
-
0
votes0
answers162
viewsMake downloading Html5 video difficult
I would like to make it difficult to download Html5 videos from the URL, which the user can inspect (examine with browser functions). Searching the Net saw that there is a 100% way not to allow the…
-
0
votes1
answer366
viewsI cannot create a Feature in the src/test/java folder
I am trying to create a Feature file in a Maven project but it does not appear the file option inside the directory: src/test/java. I have another computer with the same version of eclipse and java…
-
0
votes1
answer21
viewsI’m trying to enter a name and then play it, but I want to make it only possible to put letters
import javax.swing.JOptionPane; public class Exer { String name1; public void name1() { String name1 = JOptionPane.showInputDialog("Por favor informe um nome"); try { System.out.println("Nome:" +…
-
0
votes1
answer100
viewsMethod superscript applies to all class hierarchy?
When there are several extends (as in the example below) all methods are overwritten to the last extends? If not, which method will be used? class D extends C { void x() { System.out.println(1); } }…
-
0
votes1
answer45
viewsNull arrives attribute in Managedbean
I have an object called Historicosituacaodocumentacaoprotocoloonline, this object has some dates, a description and another object, called Situacaodocumentacaoprotocoloonline. The dates are being…
-
0
votes1
answer127
viewsProblem with the Tomcat!
Hi! I’m trying to activate apache Tomcat v7.0 in eclipse, but when I activate it this error happens: "-Djava.endorsed.dirs= apache-Tomcat-7.0.94 endorsed is not supported. Endorsed standards and…
-
0
votes1
answer84
viewsHow to make Requestcontext thread-safe?
In one project I am using the component "Demoiselle-Scheduler-Quartz". In this project several threads are fired and executed concurrently. The "Demoiselle-Scheduler-Quartz" component injects the…
-
0
votes0
answers69
viewsPhoto taken from Android camera error API 21
When making a photo with android camera my app creates a preview of this photo in an Activity where it will be sent by and-mail, however the code below is working perfectly for android below version…
-
0
votes0
answers42
viewsI’m developing a quiz and I can’t change my screen. What’s wrong with my code?
public void botaoClick(View view) { Button botaoResposta = (Button) view; if (botaoResposta.equals(respostaCorreta)) { acertos = acertos + 1; pontos = pontos + 10; Intent intent = new…
-
0
votes1
answer1296
viewsHow to use bootstrap in spring boot correctly
Hello guys I’m new to Spring Boot and I’m having difficulty in some things related to Spring + Bootstrap I have an application that I put http://localhost:8082/functionCast it works normal, the page…
-
0
votes0
answers238
viewsCalling a method in another Android class
Good morning gentlemen, I’m with a doubt, I’m trying to call a method that is in another class but is not working, this same method already works if using another layout, just wanted to implement it…
-
0
votes1
answer232
viewsHibernate + Criteria: could not resolve Property
I’m trying to search my bank when making the User registration. Next, in my user registration have two Spinner(Company, Person) I would like to popular the person Spinner with only the people…
-
0
votes1
answer185
viewsValue attached to variable within setOnClickListener is not being considered
So I’m making a test app more to study even, I’m beginner on android do not know much, I’m trying to make in the application when I click on an image that it enters this method :…
-
0
votes0
answers16
viewsTest result window netbeans is not showing the tests
When I right click on a Maven project that contains Junit tests it shows the test results in the "default" output the same as the build result. I want it to show the tests in the test window and not…
-
0
votes0
answers24
viewsExternal Connection Postgresql
I have a java application on my computer running offline along with a database connection, with full access. I wonder how I would do so that if this program is installed on another computer, the…
-
0
votes3
answers412
viewsHow do I create an Arraylist of objects with each position containing a new object?
public class Produto { String marca; int quant; Produto prod = new Produto(); ArrayList <Produto> lista_de_produtos = new ArrayList<>(); lista_de_produtos.add(new Produto()); //É dessa…
-
0
votes1
answer6065
viewsHow to emulate iOS? To test apps
Hello I need to develop an app that runs on android and iOS. I’m thinking of using React Native. I was told about Flutter but I’m afraid that I have little time. So I thought.... how will I test the…
-
0
votes1
answer137
viewsAutocomplete + PHP + MYSQL
I’m running some autocomplete tests to put in a form on my website, but when I run the autocomplete, it doesn’t work. I even searched for possible errors that occur in the autocomplete and found…
-
0
votes2
answers922
views -
0
votes1
answer56
viewsHow to avoid the intersection of 2 objects
I have a game problem I’m developing. The problem is, I’ve got two planes that can stand on top of each other and I don’t know what to do, any suggestions? Plane code1 int vBola=550; int CBola=600;…
-
0
votes1
answer536
viewsUni-directional Onetomany mapping with 3 classes using 1 single class
Good night, I have the following structure: @Entity public class Endereco { private String logradouro; private String numero; private String cep; private String bairro; private String complemento; }…