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
answers43
viewsUpdate child without deleting record using JPA
I have an entity that has a list inside it. That list is the same type as her entity. Ex: public class Aluno(){ List<Pessoa> responsaveis = CollectionsBuilder.createDefaultArrayList(); } When…
-
1
votes3
answers910
viewsEncoding without configuration: Eclipse (JSP) and Vscode
I have some problems related to encoding. Both in eclipse and Visual Studio Code are aimed at UTF-8. When I repair and save using the eclipse, it goes fine. But when I save in Vscode, the encoding…
java eclipse jsp character-encoding visual-studio-codeasked 6 years, 3 months ago Thiago Cunha 1,356 -
1
votes0
answers90
viewsRemote connection with Postgresql only works after PING
I have a JAVA application running on one server and the database running on another. Both servers are connected and on the same network, postgresql is enabled to receive external connections. But…
-
1
votes0
answers21
views -
1
votes1
answer1605
viewsRemoving items from a Onetomany relation by default
I have an entity that has a list attribute of type Onetomany: @Entity public class Pai { private List<Filho> filhos; //demais atributos... @OneToMany(mappedBy = "pai", cascade =…
-
1
votes1
answer72
viewsExample to interact res/xml/prefs.xml with a.java activity.
As much as I’ve searched, I’ve never found an exact example where a preferred file interacts with a Java activity, for example: private void Bemvindo(){ Toast.makeText(this, "Seja bem vindo",…
-
1
votes1
answer1749
viewsHow to make a Java algorithm that can measure the running time of the Heap Sort sort sort algorithm?
I started my algorithm this way so that I can measure its running time, but I’m not sure if it’s right, how to continue with an example: package heapsort; public class Heapsort { public static void…
-
1
votes1
answer40
viewsAndroid app without connection to valid IP addresses
I am having a very strange problem with my android application, in certain cases my application can not answer valid addresses from other locations. Explaining my application, is a field data…
-
1
votes2
answers670
viewsHow to hide the background of images in the android studio app?
I’m new in programming I’m programming an app in android studio that is practically ready. When I copy it on my Moto G2 with android 6.0 works perfectly however when I copy on the Moto X1 android…
-
1
votes4
answers1245
viewsHibernate - How to search all rows of a table with Hibernate?
I am not able to find all rows of a table with Hibernate. Does anyone know the name of the method that does this?
-
1
votes1
answer80
viewsJson for android Markers
I’m trying to loop markers from google maps, picking up information from a json, but I’m stuck on "transferring" the information from doinbackground to the Google method. To better understand,…
-
1
votes1
answer90
viewsSuggestions from the IDE / how to do?
I have the following problem I have some text that will be inserted by the user and we will take as an example Inserted sentence: I wish I knew how to program better #today. I wanted a listview to…
-
1
votes0
answers60
viewsTwo Jboss servers. Start and one not. Same configuration
I have two servers that run Jboss with the same parameters for the same application. Although the log clearly indicates the error, I do not understand why one server works and the other does not. It…
-
1
votes1
answer498
viewsWhat’s the difference between running and executing?
What’s the difference and when to use executeQuery() or executeUpdate()?
-
1
votes0
answers34
viewsHow to get the name of a section that contains a String
The code serves to get all the sections in the YML file, so far it is working, but I do not know how to get the section that contains the name "So-and-so", for example: Grupos: Usuário: pessoas: -…
-
1
votes1
answer82
viewsGetresponse - Httpurlconnection
I’m trying to make a comeback getResponse. I can see the return with the System.out.println, but I can’t get the same feedback within the application. HttpURLConnection conexao =…
javaasked 8 years, 2 months ago Wagner Fillio 1,328 -
1
votes1
answer584
viewsJson Post Unsupported Media Type Spring MVC
I’m performing a POST using ajax data format JSON for a controller in Spring MVC, but the server is refusing such a request Unsupported Media Type stating that the type is not supported. Have some…
-
1
votes1
answer3159
viewsReplace in the inverted bar " " in java
I need to take the backslash (" ") of a string, I’ve searched in several ways, but none of it worked. Please help me, follow code. f = new File(path,prefix + "_" + dataArq + "_" +…
javaasked 6 years, 2 months ago Otavio Faria 70 -
1
votes0
answers577
viewsSelenium opening two browsers even I instantiating only one
Galley, I am using Cucumber with Selenium in JAVA. I have the following problem: every step I do: private WebDriver driver; @Before public void before(){ driver = new FirefoxDriver(); }…
-
1
votes2
answers1233
viewsError reading java properties file
I do not know if it is correct and if it works, but I realized a division in the project. a project would access the DAO and have the connection and a properties file with the connection…
javaasked 8 years, 2 months ago Ulisses Gimenes 443 -
1
votes0
answers157
viewsError: android.view.Inflateexception: Binary XML file line #0: Error inflating class <Unknown>
Whenever I run my app on some devices (In the ones that received this error, API was 21. In the others with higher API works without errors), this error message appears that I can’t decipher. It…
-
1
votes3
answers318
viewsHow do you get part of a String?
I just need to get the [nItem:2] of Phrase: Nota fiscal - 502: Status do retorno da transmissão: 778 - Informado NCM inexistente [nItem:2] Would anyone have any idea? Remembering that only interests…
javaasked 6 years, 2 months ago Leandro Santos 453 -
1
votes1
answer843
viewsHow to open a file when clicked on a java application?
I made an application in Java and I want to open a certain type of file in it, like with Netbeans, that is when a person clicks on the file ". java " it opens in Netbeans( or another IDE that…
-
1
votes1
answer338
viewsNo serializer found for class sun.security.util.Objectidentifier
I have the following problem: Error: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class sun.security.util.ObjectIdentifier and no properties discovered to…
-
1
votes1
answer502
viewsHibernate.hbm2ddl.auto Invalid Object name 'sys.sequences'
Hello, I have the following code snippet in my context.xml: <prop key = "hibernate.dialect"> org.hibernate.dialect.SQLServer2012Dialect </prop> <prop…
javaasked 6 years, 2 months ago Fábio Luiz Schmidt de Oliveira 301 -
1
votes0
answers66
viewspaintComponent() method deleting images in Jframe
I need to generate a map according to a txt file that I receive as input. Each font of my txt file corresponds to a type of map terrain. I created arrays of Image that will store the images that I…
-
1
votes2
answers254
viewsFill Map without duplicating records
I own a List of an object A. In this object, I have 2 attributes: Long and a BigDecimal. How can I create a Map where the key will be Long and value will be the BigDecimal, using a lambda? The…
-
1
votes0
answers228
viewsError: Failed to execute Goal org.codehaus.mojo:exec-Maven-plugin:1.2.1:exec
I am developing a web application with Spring + Maven + Hibernate, already created my class HibernateUtil and created a test class ConectaHibernateMySQL to verify my connection to the database.…
-
1
votes1
answer215
viewsHow to update Java application format . War for several clients?
I have a Tomcat 8.5 server and have deployed a .war.file. It works perfectly. My question is, each client has a server deployed in their company, so I will distribute the same file . War to several…
-
1
votes0
answers96
viewsJpaupdateclause with Join
I have the following entities: @Entity @Getter @Setter @NoArgsConstructor @Table(schema = "MYDB", name = "TB_TESTE") public class Teste implements Serializable { @ManyToOne @JoinColumn(name =…
-
1
votes1
answer31
viewsImages in Listview reloading every time I select Fragment?
I’m using the drawable batch to generate different images according to dpi. Each original image has a resolution of 1920x1080 with an average size of 350kb. However, an image with a huge size of 4mb…
-
1
votes0
answers89
viewsGlassfish integration with Eclipse Photon
Has anyone ever used glassfish with eclipse Photon? How to do integration? I’ve tried several ways and nothing. Does not install the glassfish plugin. I tested with the oxygen eclipse and also had…
-
1
votes1
answer749
viewsOpen external links in another browser
So I have an App that is my whole responsive site and is working perfectly. But I would like the external links to be opened in another browser. For example: You click on a Google Adsense ad that…
-
1
votes1
answer101
viewsHow to center a recyclerview (horizontal) item horizontally on the screen?
What I want is the following result: Whenever the user moves to the next or previous item, it will be centered on the screen, just as it works if I use Carousel. I tried some libs from Carousel only…
-
1
votes1
answer397
viewsHow to download Webview files from the Sdcard if available
The App is a simple browser that works like Webview. This code makes the files to be downloaded into a custom folder and works perfectly. mWebView.setDownloadListener(new DownloadListener() {…
-
1
votes1
answer208
viewsHow to download data from firebase by Storage?
I used the documentation provided by Firebase and still did not understand how to download a file that is in Storage by my app.
-
1
votes1
answer1303
viewsWhat is a git diff, how to do it, and what is it for?
I’m having a problem with my project. I make contributions to a git project, and when I check the Master branch, I saw that some methods are missing that you have in a branch, but don’t have in…
-
1
votes0
answers50
viewsAlternative to the stabbing
I would like to know if you have any Pattern design or alternative approach to Pattern facade. I found interesting his approach in creating a "facade" for a certain "subsystem" but the class that…
-
1
votes1
answer521
viewsOnetomany mapping with HIBERNATE associative table - JPA
I need to do a hibernate mapping of a relationship 1:N in two tables, however there is an associative table that has as columns the ids of the other two tables. Example: The table Servicos may…
-
1
votes0
answers521
viewsAutomate website browsing for software testing activities
I’m on a web systems development project, accessed by the browser. We are constantly making modifications in the operation of the processes and at each specific period we perform a test on the…
-
1
votes1
answer30
viewsPlugin to create runtime variable instance builder
I need to create some tests using variables already instantiated at runtime, and instead of manually mounting, object by object, attribute by attribute, I would like some tool that automates this…
-
1
votes0
answers49
viewsDoubts with jssor carousel
I’m using the carousel for on my page, follows image so far so good , the problem is when I open it on mobile, it decreases the carousel , and I wanted q it plays down , follows image I’ll send you…
-
1
votes1
answer928
viewsIn descending order, remove a value from the inserted number to 0
I need the program to remove a value from the user’s number until it reaches 0. I don’t know if the loop used should be the for, but my program was like this. package numerodescrecente; import…
-
1
votes0
answers279
viewsAttribute drawableTint is only used in API level 23 and Higher
I’m trying to put a colorful icon on EditText but the Android Studio is warning that the attribute that colors the icon (android:drawableTint) is only supported in API's >= 23. What do I do to…
-
1
votes2
answers406
viewsMemory consumption in java
Good morning Personal. I made a java application that at certain times it executes a database query and generates a text file. The application is working right in the schedules that were programmed,…
-
1
votes0
answers316
viewsNo Setter/field for found on class
So, guys, it’s kind of a beat-up question I know, but I couldn’t find a solution to my code here. I need to get the information that’s inside node 5883, but apparently it populates my class with the…
-
1
votes1
answer760
viewsRequest permission to access Android internal storage by a Fragment
How do I make to request permission to access internal storage of the apparatus by a Fragment? In the normal Activity I used that code: int REQUEST_CODE = 0;…
-
1
votes0
answers94
viewsHow to initialize Hibernate with Reflection
Hello, I need to initialize a list using Hibernate.initialize(list) within a Generic DAO. User Model @Entity public class Usuario { @Expose @ManyToMany(cascade = {CascadeType.PERSIST,…
-
1
votes1
answer631
viewsHow to add an event to the Trayicon notification balloon?
I have an app that uses the class TrayIcon and I’m displaying a message through the method displayMessage(). (A small "balloon" that rises from the icon represented by my Trayicon). The method call…
-
1
votes0
answers73
viewsIllegalargumentexception when deploying Spring Boot application in Weblogic
I am not being able to successfully deploy my Spring boot 2-based application to a server running Oracle Weblogic 12.1.3 due to this error: weblogic.application.ModuleException: null null at…