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
votes3
answers210
viewsLoad Tomcat into Java Desktop application
After a lot of pain, I was able to develop a Java application, with graphical interface (swing), which simulates access to a particular site and extracts data. The problem is that as it simulates a…
-
0
votes1
answer38
viewsUse Hibernate to save two equal classes
Good afternoon, I’d like to relate the class Partida with class Time, where departure would receive the PK(Id) of the home team and the visiting team. I am doubtful how to relate in both classes,…
-
0
votes1
answer451
viewsHow do I resume the amount of Spring JPA records?
I want to return the value of playlists at the bank, but that code there did not work. public interface PlaylistDao extends JpaRepository<Playlist, Long> { @Query("select count(*) from…
-
0
votes2
answers715
viewsJSON format in Localdate field
Personal have the record sequinte being returned by a query using SpringData: page = grupoService.findByNomeStartingWithOrderByNomeAsc(2, pageable); If I run the following code:…
-
0
votes3
answers345
viewsGet external IP in Java - Android Studio
I want to get my external IP by clicking a button in my app, but every time I click the button, the app closes itself. How can I do that? My code: public void onClickBtnAtualizar(View view) throws…
-
0
votes1
answer113
viewsCount the number of notes
The program needs to enter the value of notes. When typing, the program must return number of notes 20,10,5 1 /* Code in Java */ import java.util.Scanner; class HelloWorld { public static void…
-
0
votes2
answers40
viewsHow to avoid layout destroyer in Tabbed Layout when changed tab?
I am making a system with tabbed layout and with Recycler view, in the first tab are the products, I click on a place the quantity and it marks the product. When I go to the third tab, the marking…
-
0
votes0
answers175
viewsAndroid Listview does not display the first item
First thank you for trying to help, come on! I own a project made in Android Studio where it contains a custom Listview that I used along with my INTERNAL database. After the project has evolved, I…
-
0
votes2
answers53
viewsHow to Select a Query
I’m having doubts about how to make a SELECT in my database. Here are the classes I use: DBHELPER public class DBHelper extends SQLiteOpenHelper { private static String NAME = "sqlitejuh.db";…
-
0
votes1
answer133
viewsEdittext Multiline with lines separated by dashes
All right? I’d like you to help me with something: I would like to have an Edittext with Multilines divided into lines. What I mean is this: When we create a multiline Edittext (let’s put as an…
-
0
votes1
answer36
viewsIreports, generate variable number of subreports
I’m using Jasper for reporting, using Ireport to build Layouts. I have a main report that has a sub report (the reason for my problem), my main report receives a list of objects, I need to generate…
-
0
votes0
answers43
viewsEdit a Spinner recorded in the Bank!
I am trying to edit some information of a product registered in the database, but the problem is the following: all the information in "String" I can manipulate well, I only have one information…
-
0
votes1
answer200
viewsCopy specific XML file TAG and merge with another XML file
Situation: - I need a single XML file that contains the data of all other existing and upcoming files. But I can’t just join one file with the other and I just need a specific tag. Is there any way…
-
0
votes0
answers200
viewsHow to inherit attributes from 2 different classes in JAVA?
I am trying to inherit the attributes of the Physical and Legal classes, but I know that in Java there is no multiple inheritance. How can I use the attributes of the Physical and Legal class in the…
-
0
votes2
answers102
viewsAdapter modified in real time
I have a Activity calling for ListaBasica and a Adapter by the name of adapterBasico. The Adapter contains a list of newsletters. A Activity contain information taken from Adapter as the sum of the…
-
0
votes1
answer42
viewsConnection problem with Database
I made a program to try to connect to a hosted database. However an error is occurring : 08-30 10:42:13.088 1710-1710/genus.qrcodefinal E/log_tag: Error in http Connection…
-
0
votes1
answer75
viewsI cannot render a component after clicking a button
I can’t render the include component that’s inside a panel, I want to render by clicking a button inside a datatable, but when I click the button nothing happens View Arts Aptas a Book of Order…
-
0
votes2
answers253
viewsIs it possible to generate an executable in Android Studio?
Hello, I want to run my Android application on PC (Windows) without emulator, so it is possible to install with . exe, this is possible?
-
0
votes1
answer124
viewsHow to pass a parameter between two views with @Viewscoped
I need to pass an id of an object between the views, the Beans of both are view scoped, I’m trying to pass via f:param, but I can’t. The value always arrives null in the other view View 1…
-
0
votes1
answer443
viewsConsume Webservice C# on android
I have a Web Service created in C# where I access a certain method to authenticate a teacher, if the user and password data passed through parameters exiting in the database the web service returns…
-
0
votes1
answer79
viewsChange Textview from one tab to another in Tabbedlayout
I am using Tabbed Layout ("activity_carrinho"), and have three separate Ragments for each screen, fragment_product, fragment_client and fragment_payment. As it needed the screens to remain intact…
-
0
votes1
answer57
viewsText breaking in Android notification Using upstream FCM
Upon receiving the notification the text is not displayed completely, at the end of the text an ellipsis is shown, how to resolve this. Below the notification sending code…
java android firebase-cloud-messagingasked 5 years, 10 months ago jallisson jallis oliveira band 100 -
0
votes1
answer137
viewsireport - Error using Print When Expression
I have a problem generating the report, the function does not work print when expression, always the report shows that line with the value null I’m doing so in line…
-
0
votes1
answer80
viewsError variable stmt of type Statement
I’m trying to run the table, but in netbeans it keeps alerting the error in the Executequery line. Symbol: method executeQuery(String) Location: variable stmt of type Statement The error is…
-
0
votes2
answers7370
viewsRegex special characters required
I need to create a regex to validate password. It must contain at least 8 characters, of which it must have at least 1 letter, 1 number and 1 special character.
-
0
votes1
answer110
viewsLimit @Onetomany List
Good morning Guys! I have some problems in a list that in some cases do not need to return it completely @OneToMany(mappedBy="local", cascade=CascadeType.ALL, fetch = FetchType.EAGER)…
-
0
votes1
answer57
viewsjavahome installer argument (PSSAV)
Hello, good night, good night! I am in need of installing PSSAV for a college exercise. However it presents the dialog box below: I happen to be with JDK version 8. The information that I can…
-
0
votes2
answers75
viewsGetting HTML table data from JSP
I search the data in the database and mount a table in my JSP. The information is from several flights of an area company. The goal is to choose an air ticket among all loaded. I intend to put a…
-
0
votes1
answer74
viewsMethod not called when using command button
I have two methods in two different dialogs: adicionarRelato and RetificarRelato. The adicionarRelato performs perfectly at the click of command button in the first dialog. But the retificarRelato…
-
0
votes1
answer673
viewsHow to Handle Exceeded Maximum File Upload Size
I have an application, which uploads a file (spreadsheets), but after a recent test pointed out this error: Caused by: java.io.IOException: UT000054: The maximum size 1048576 for an individual file…
-
0
votes0
answers553
viewsPrimefaces - Requestcontext Update
Hello, When loading the page the method iniciarTeste() will be called as follows: <f:metadata> <f:viewAction action="#{testeController.iniciarTeste()}" /> </f:metadata> On the same…
-
0
votes2
answers148
viewsIs it possible to extend a class via java Reflection?
I work with an API that changes the class name and package name whenever a major update comes out, however, I am required to support older versions of the API and for that I use Reflections in these…
-
0
votes0
answers137
viewsRendered attribute not working in p:dialog
I need to render a form that is inside a panel in p:dialog and after I save the data, I want to hide it and render a p:fileUpload in p:dialog. But I can’t do it, I don’t know what’s wrong. The…
-
0
votes1
answer50
viewsHide and Render component in p:dialog
I need to attach files and save the path in the database. Attachments belong to an object that can have multiple attachments, so I created an entity to store the path in the database, however I need…
-
0
votes3
answers2698
viewsUsing 2 versions of Java
My company uses a maintenance-free application that I can’t change, it runs with Java 6.0.17, however in all other applications newer versions of Java are required. As a solution I made a file .bat…
-
0
votes0
answers47
viewshttpresponse resume error
I have the following class: package carcleo.com.radiosingular.classes; import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.URI; import android.os.AsyncTask; import…
-
0
votes0
answers1502
viewshttps problem Excessive redirection
On my web system, when I add code to web.xml: <security-constraint> <display-name>ConstraintSSL</display-name> <web-resource-collection>…
-
0
votes0
answers21
viewsHow do you take the value of a static attribute inside a method when you have a variable with the same name in that method?
When it is a non-static attribute you can use the this.nomeAtributo. Example: public class NomeDaClasse { private String atributo; public void (String atributo) { fazerAlgo(this.atributo);…
-
0
votes0
answers74
viewsJAVA Application jumps commands
When I choose case 1, it works ok. But if you choose this option again, the console shows the menu, as if the option did not work. Is there any error visible in this code? { import…
-
0
votes1
answer557
viewsError while trying to deploy java Tomcat application
Good evening, I hired a hosting service on Uol host and went to try to deploy a java application. I put . From my application inside the webapps folder of Tomcat, it tries to upload the application…
-
0
votes0
answers43
viewsJAVA WEB App with Installer
I need to make a slightly different application, I’ve seen something similar in PHP, the famous Wordpress or Joomla, they work like that: You download a zip and unzip in the web server directory…
javaasked 8 years, 1 month ago Marcelo Ribeiro 101 -
0
votes0
answers319
viewsLosing database connection. Postgress, Glassfish
After about 15 minutes my system stops communicating with the database. Log Entry Detail Close-up Timestamp 05/09/2016 21:22:30.287 Log Level ERROR Logger…
-
0
votes2
answers307
viewsLoop in time interval
I need to go through an hour interval to assemble a grid with schedules. Example: range 08:00 to 10:00, adding 30 minutes. Forming a grid like this: 08:00 08:30 09:00 09:30 10:00 I’m trying like…
-
0
votes1
answer84
viewsWhat is the purpose of the file (.exe) in Java programs?
After a while creating desktop applications in Java, I was curious to research some professional applications. I saw that Netbeans and Minecraft were made in Java. But when I looked in the folders…
javaasked 5 years, 9 months ago user135698 -
0
votes1
answer93
viewsAndroid App closes when adding Firebase and cardview
Every time I add : compile 'com.android.support:cardview-v7:27.+' and compile 'com.google.firebase:firebase-core:16.0.6' Together the app just doesn’t work. How to resolve?…
-
0
votes1
answer728
viewsSpring MVC annotations not working on Maven
Hi, I’m having a problem setting up Spring MVC in the Maven, when I try to access the http://localhost:8080/spring/olaMundoSpring it returns in browser: STATUS 404 The requested Resource is not…
-
0
votes1
answer240
viewsRun sh in java
I am trying to run a file in java with the following command System.out.println("Linux"); String[] env = {"PATH=/bin:/usr/bin/"}; String cmd = System.getProperty( "user.dir" ) +…
-
0
votes0
answers61
viewsCopy apk located at /data/app/ programmatically
Hello, i would like to copy an apk located in the folder /data/app/.. But apk is not being copied, only the folder is created, follows the code: InputStream input; String apkPath =…
-
0
votes1
answer48
viewsJasperreport - Passing Objects to report column
I have to take the dice from the following field : venda.getVendacardinalidades().get(0).getUsuario().getPessoa().getNome() And put this value in a report column, how do I do that: I was trying to…
-
0
votes1
answer121
viewsHow to differentiate static types from dynamic types?
all right with you guys? I had another OOP class today, and today’s topic was the beginning of substitution and the static and dynamic types. I did not understand the definition of these concepts…