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
-
2
votes1
answer369
viewsConvert cer certificate without PK to PCKS12
I have a Certificate in my account and need to export it to authenticate on a site - following these procedures: link. Only that on import in windows, it does not export along with the private key.…
-
2
votes2
answers2979
viewsInvert values from one vector to another vector
I am in the second semester of college, we are learning vector, and I am very lost in the exercise list. An exercise asks the user to type 5 elements for a vector, and then I have to take these…
-
2
votes0
answers202
viewsDoes an Android service lock the application even running in the background?
Does an Android service lock the application even running in the background? Or is there something wrong with my application? I have a database where the last table has 3,000 lines. With this I…
-
2
votes1
answer111
viewsWhy doesn’t Entitymanager have the createQuery method with typed return?
I am following the project of the book Spring-MVC of Casa Do Código, using the latest version of Hibernate, a 4.0.3. But in a moment, when the book indicated the creation of a typed query through…
-
2
votes4
answers311
viewsCreating Data Base through Stringbuilder
I am creating my database with the class sqliteOpenHelper, passing the creation of DB by String through the StringBuilder. The problem is, it’s just creating the first table, and then it doesn’t…
-
2
votes6
answers615
viewsRegular Expressions with Java Patterns
I need to do a college exercise, which is this: Validate with regular expressions any word that contains exactly two characters 'a' and two characters 'b' or more. I made the following expression in…
-
2
votes1
answer319
viewsWhat are the options to initialize a final variable in a Java class?
Given the class below, what are the boot options for the variable ANGLE, since final can be initialized only once? class Triangle { public int base; public int height; private final double ANGLE; }…
javaasked 7 years, 9 months ago Murillo Goulart 3,391 -
2
votes0
answers96
viewsWildfly in production does not recover properties and SQL script values
I am using a development environment and another production environment, in the development environment using the concept of i18n (Internationalization) is recovered correctly for example the value…
-
2
votes2
answers94
viewsGive replace to the chars of a string
Well, the title of the topic says it all. Like, I got the String a = "Banana é uma ótima fruta.", how do I give replace in the chars of the word "Banana" ? I wanted the replace to stay, "****** é…
-
2
votes1
answer1526
viewsHow to validate a signature with a private key?
I receive an HTTP request that comes in the HEADER a signature (SHA1). I own, stored in a String, a private key. I need to generate the signature between the BODY of the HTTP request and my key and…
-
2
votes0
answers139
viewsRequesting running permissions on Android Marshmallow
I’m working on a app integrated into the services of GoogleMap. The app was working perfectly but I want to add the controls of permissões for use in API23 (Android Marshmallow). I studied the part…
-
2
votes0
answers184
viewsHow to change HTML input values with Edittext using Webview?
Is there any way to change a form field by taking the Edittext value, using a Webview client ? I have an application in which accesses my site and there are 2 fields, a user and another password,…
-
2
votes1
answer52
viewsWhat happens after Wait synchronization?
Look at these two codes in separate threads Thread A synchronized(objeto) { while(condicao) objeto.wait(); //operações } Thread B synchronized(objeto) { condicao = false; objeto.notify();…
-
2
votes3
answers950
viewsHow to limit the characters of a label?
I’m in an e-commerce project, and I need to display a product name. I’m thinking of using a label for this. The idea is to leave x characters visible, if the title exceeds this number x of…
-
2
votes1
answer825
viewsCheck if the value already exists in the txt file
I am developing an inventory application that in its freeware version will work with the data inserted in a txt file line by line, the data structure will be as follows Barcode + Description +…
-
2
votes2
answers2969
viewsHow to sort and sort strings without using Collection?
I am creating a register of employees with some fields(name, email, phone and salary) in ArrayList which are recorded in txt. After the data is entered into the array (before passing to txt) they…
-
2
votes1
answer717
viewsError 403 Forbidden while consuming CEP webservice
I’m trying to consume a webservice of ceps but always returns me 403 and it is public. Testing the Working Webservice : http://apps.widenet.com.br/busca-cep/api/cep.json?code=01001000 My Controller…
-
2
votes1
answer468
viewsHibernate Multitenant problem with identification of current tenancy
I am using Hibernate multitenant by schemas, use Postgresql database. My problem is the following I have a service where I make a select in a public schema table, then for each returned item I have…
-
2
votes1
answer1278
viewsHow to rotate an array (array) in Java?
I have a two-dimensional array, of size M x N, that stores Tiles of a map, in the following format: [1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12] And I want to rotate 90º (e.g., turn the map so that…
-
2
votes1
answer119
viewsRedo the Spring cache?
It is possible to schedule that the Spring cache is always redone at midnight? I read the Springs Cache Docs and I found nothing about how to get him to be regenerated.…
-
2
votes1
answer66
viewsAndroid app error 5
I developed an android app that works perfect, but does not run on android 5, I do not know what else to do ... Follow the log cat : 11-19 20:36:27.387 24358-24358/? I/art: Late-enabling -Xcheck:jni…
-
2
votes1
answer129
viewsAutomatic zoom
I don’t know this function is native to the Google Maps API but I’m not able to zoom in on my location map, follow my code. public class MainActivity extends FragmentActivity { GoogleMap mGoogleMap;…
-
2
votes1
answer97
viewsI can’t select multiple objects from my components
I am using a component of the primefaces, only when I select several items of this component I cannot select. I am using an Enum, it needs to be an arrayList? <h:outputLabel for="servico"…
-
2
votes0
answers73
viewsProject error downloaded from github with Jboss 7.1.1
I downloaded a project from github (fj25-financas-web project - Caelum) and added this project to Jboss 7.1.1. When running, these errors occur: 16:07:15,515 ERROR [org.jboss.msc.service.fail] (MSC…
-
2
votes1
answer96
viewsksoup2 org.xmlpull.v1.Xmlpullparserexception:
I’m trying to make a query in the WEB SERVER implemented in PHP in this link. In the web service I have to send a request by passing the parameters Imei, password, operation. public class…
-
2
votes2
answers404
viewsExtract groups with regex
I need to extract the Session and the date from the line below, and the date I have separated with dash and slash. The Patterns work properly individually but when I try to extract both, nothing…
-
2
votes2
answers429
viewsHow to change a list of another Managedbean
I have developed a search area on my system where the user can add an item to their list of items. Like a shopping cart. The search area uses a different Managedbean than the user panel that has a…
-
2
votes2
answers1128
viewsFTP connection is not listing files
I am not able to list the folder files via FTP (through Filezilla I can access list correctly): FTPClient ftp = new FTPClient(); ftp.connect("ip_ftp"); ftp.login("usuario", "senha");…
-
2
votes1
answer53
viewsAll Admob needs is an XML code?
Admob only needs this code or needs some created class?…
-
2
votes1
answer73
views -
2
votes2
answers2948
viewsError: "Cannot make a Static Reference to the non-static method from *"
Good morning, I have a following error warning. on line 23 and 24 of the User.class. Says: Cannot make a Static Reference to the non-static method from User. public class UsuarioDAO { public static…
javaasked 8 years, 12 months ago Júnior Nascimento 679 -
2
votes1
answer83
viewsHow to maintain the data of a variable, when starting an Actitivy, and when returning, load the value?
I’m having the following problem, and I’d like everyone’s help please. I have an Activity, in which, if you press btn1, it will happen Boolean mesa1 = true; Just like for btn2... successively. When…
-
2
votes1
answer508
viewsError installing Jboss Forge
I’m trying to install the forge in my machine (windows 10) via prompt. but when executing the command: C: Users Leonardo Desktop Forge-Distribution-2.20. 1.Final-offline Forge-Distribution-2.20.…
-
2
votes1
answer116
viewslist.clear() vs list = new Arraylist<T>()
To remove all items from a list, I can do it in two ways: lista.clear() and lista = new ArrayList<T>(). What are the differences between them? In which situations should I use each one?…
-
2
votes2
answers294
viewsHow does Junit work?
How does the Junit open-source framework work? Does it guarantee the quality of the software? It is recommended to write unit tests on a daily basis?
-
2
votes1
answer78
viewsJava - How to validate user group in SQL and Save result?
Good morning, I have the following code in Java Desktop. I wanted to know how I can capture this user’s group and save it into a variable. Since when it returns the value and stores in the variable…
-
2
votes1
answer166
viewsSchedule job to run on the Wildfly server
I need to create a task runner where it will call a method from time to time. I saw an example and it was like this my implementation: public class Agendador { // Scheduler private final…
-
2
votes1
answer1761
viewsHow to get the value of the <version> property in pom.xml?
I need to get the value of the current version of the application in various parts of the code. A priori I thought of creating a class containing the version: public class Version { public static…
-
2
votes0
answers51
viewsOpening Sqlite3 in Windows10
When I open Sqlite3 on Windows 10, it simply opens the command prompt, giving command permission in front of the line sqlite>. Already in windows 7 and 8 it opens normally. My intention to use…
-
2
votes1
answer252
viewsGeneric dialog on Hymeleaf
Good evening friends, Has anyone ever tried or done a generic dialogue on Hymeleaf? What I want is: Instead of writing code to confirm the deletion of a data on the screen that is something simple,…
-
2
votes1
answer213
viewsError: "You have an error in your SQL syntax"
I’m getting the following error while executing the change attempt in the BD: You have an error in your SQL syntax; check the manual that Corresponds to your Mysql server version for the right…
-
2
votes3
answers92
viewsManipulate String in JAVA?
I have an appointment of SQL that the content brings me so: [email protected];[email protected] I only need the first address, I have to disregard everything from the ;?…
-
2
votes1
answer46
viewsClient - Console error server
I have a client and server working to send messages from a Chat application but an error on my console when I try to write a message. Can someone explain to me the mistake? Error on console Cliente…
-
2
votes1
answer772
viewsItems repeating in a Recyclerview
I have a fragment v4 which is managed by a SectionsPagerAdapter. In the fragment have a RecyclerView who has a Adapter personalized that receives a ArrayList which contains exactly 96 objects,…
-
2
votes1
answer60
viewsCode the closure of an application
Hello, good afternoon everyone! I have a problem with the company’s software. I created a serverSocket when starting the application, and with this I can control so that only one application is…
-
2
votes1
answer90
viewsLogin method always returns false
I created a method that returns a Boolean value for access in a program I’m doing. If the user can log in, then returns true, if not, return false. But it’s always coming back false, regardless if…
-
2
votes1
answer1471
viewsJavafx Tableview apparently takes the value but shows null
Hello, I am migrating my program to Javafx to study only, I want to stop using Swing and pass only FX, but as in a previous time I gave up due to my difficulty in Tableview, without delay: I’m…
-
2
votes0
answers458
viewsConfigure jboss to request digital customer certificate
I am making a web application using jboss EAP 6.1. As one of the requirements, the system must perform user authentication via digital certificate. For this I have properly configured jboss to run…
-
2
votes1
answer51
viewsJframes Editing
I have the following code that corresponds to the Header Panel but does not give me the desired output that is in the image. Can anyone help me? public class PainelEstadoContacto extends JPanel{ /**…
-
2
votes1
answer91
viewsDisplay tree format directories
I have this code here in JAVA where I need lists of folders and subfolders in tree format, but I can’t get it. Any help? package Control; import java.awt.Desktop; import java.io.*; import…
javaasked 8 years, 11 months ago Vinícius Novelli 173