Trending questions in Java

+9 votes
16 answers

Unable to resolve this error: "javac is not recognized as an internal or external command"

Check your javac path on Windows using Windows Explorer C:\Program Files\Java\jdk1.7.0_02\bin and ...READ MORE

May 23, 2018 in Java by Rishabh
• 3,620 points
382,303 views
+1 vote
2 answers

How to find all the classes of a package in Java?

Looking on internet I found this page with ...READ MORE

Nov 16, 2020 in Java by Juan
• 330 points
344,567 views
+10 votes
13 answers

Default parameters of XMS and XMX in JVM

Run this code to see all the ...READ MORE

Nov 13, 2018 in Java by anonymous
320,152 views
+3 votes
11 answers

How to import a jar file in Eclipse?

Click on File > Import. The Import ...READ MORE

Aug 23, 2018 in Java by Daisy
• 8,120 points
280,290 views
+15 votes
25 answers

How can I convert String to JSON object in Java?

Hi @Daisy You can use Google gson  for more ...READ MORE

Feb 7, 2019 in Java by Suresh
• 720 points
233,642 views
+2 votes
14 answers

“A Non-static method cannot be referenced from a static context” error

Hey Techies, Non-static variables are part of the objects ...READ MORE

Dec 10, 2020 in Java by Roshni
• 10,500 points
226,527 views
+1 vote
13 answers

How does java.net.SocketException: Connection reset happen ?

You can use wireshark to view the ...READ MORE

Dec 7, 2018 in Java by tushh
183,335 views
+2 votes
13 answers

Unable to execute jar- file: “no main manifest attribute”

add a jar/manifest/attributes setting like this: apply plugin: ...READ MORE

Nov 27, 2018 in Java by krishti
178,563 views
+1 vote
14 answers

Communications link failure: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException

Your exception seems to indicate that your ...READ MORE

Dec 11, 2020 in Java by Roshni
• 10,500 points
166,087 views
0 votes
13 answers

What is the correct way to add external Jars to IntelliJ IDEA Project?

Adding custom JAR files to the EAR project Copy the custom JAR to the ...READ MORE

Dec 10, 2020 in Java by Nikita
156,510 views
+1 vote
13 answers

How to send HTTP POST requests on Java?

With Apache HttpClient In the old days, this Apache ...READ MORE

Dec 10, 2020 in Java by Rajiv
• 8,910 points
143,438 views
0 votes
6 answers

How can I separate the digits of an int number in Java?

You can also have a look here: To ...READ MORE

Dec 9, 2020 in Java by Roshni
• 10,500 points
125,500 views
+1 vote
12 answers

Iterate over a JSONObject?

Assuming your JSON object is saved in ...READ MORE

Dec 11, 2020 in Java by Rajiv
• 8,910 points
97,322 views
0 votes
12 answers

Java - sending HTTP parameters via POST method easily

Below are the steps we need to ...READ MORE

Dec 11, 2020 in Java by Rajiv
• 8,910 points
92,393 views
+1 vote
5 answers

How to take input using BufferedReader in Java?

yupp i am explaining every thing .. We ...READ MORE

Feb 1, 2020 in Java by Rohan
• 180 points
62,677 views
0 votes
6 answers

How can we define global variables in java?

To define Global Variable you can make ...READ MORE

Dec 15, 2020 in Java by Gitika
• 65,850 points
69,295 views
+1 vote
4 answers

How to take multiple integer input in one line using BufferedReader in Java?

To do this, we could read in ...READ MORE

Dec 14, 2020 in Java by Roshni
• 10,500 points
61,987 views
0 votes
4 answers

How can we display an output of float data with 2 decimal places in java? Please help

You can use DecimalFormat. One way to use ...READ MORE

Dec 16, 2020 in Java by Gitika
• 65,850 points
64,741 views
+5 votes
4 answers

How to execute a python file with few arguments in java?

You can use Java Runtime.exec() to run python script, ...READ MORE

Mar 27, 2018 in Java by DragonLord999
• 8,450 points

edited Nov 7, 2018 by Omkar 59,170 views
+4 votes
4 answers

Using while loop i want to print 10 even numbers

public class Loops { ...READ MORE

Dec 5, 2019 in Java by One of the Simplest ways to answer you q
53,380 views
0 votes
3 answers

HttpServletRequest get JSON POST data

Configure the action as given below: Method: Since ...READ MORE

Dec 16, 2020 in Java by Rajiv
• 8,910 points
50,541 views
+2 votes
4 answers

Javac command not working in my windows 10

Check your javac path on Windows using Windows Explorer C:\Program Files\Java\jdk1.7.0_02\bin and ...READ MORE

Aug 6, 2019 in Java by Sirajul
• 59,170 points
44,926 views
+1 vote
7 answers

What is difference between access modifier and access specifier in java

Access Specifier:- This can be understood as ...READ MORE

Feb 14, 2019 in Java by Priyaj
• 58,060 points
42,640 views
+1 vote
12 answers

Hibernate hbm2ddl.auto possible values and their uses

hibernate.hbm2ddl.auto (e.g. none (default value), create-only, drop, create, create-drop, validate, and update) Setting to perform SchemaManagementTool actions automatically as ...READ MORE

Dec 7, 2018 in Java by Shuvodip
47,015 views
+1 vote
4 answers

What is the difference between string object and string literal?

A String literal is a Java language concept. This ...READ MORE

Aug 16, 2019 in Java by Sirajul
• 59,170 points
41,324 views
0 votes
0 answers

CCAvenue Payment Error code 10002 Merchant Authentication failed. Don't worry... It happens to the best of us

I used the code which is provided ...READ MORE

2 days ago in Java by Kichu
• 16,850 points
11 views
0 votes
0 answers

UnsatisfiedDependencyException: Error creating bean with name

 I'm trying to create a Spring CRUD ...READ MORE

5 days ago in Java by Kichu
• 16,850 points
111 views
0 votes
0 answers

Server Tomcat v9.0 Server at localhost failed to start

I am using Tomcat server v9.0 but ...READ MORE

3 days ago in Java by Kichu
• 16,850 points
23 views
0 votes
0 answers

Error: The processing instruction target matching "[xX][mM][lL]" is not allowed

An error occurs when I run I ...READ MORE

3 days ago in Java by Kichu
• 16,850 points
21 views
0 votes
0 answers

How can I fix 'android.os.NetworkOnMainThreadException'?

When I run the Android project for ...READ MORE

3 days ago in Java by Kichu
• 16,850 points
11 views
0 votes
0 answers

Converting Java objects to JSON with Jackson

I need my JSON to be like ...READ MORE

3 days ago in Java by Kichu
• 16,850 points
5 views
0 votes
0 answers

How to avoid java.util.ConcurrentModificationException when iterating through and removing elements from an ArrayList

I wanted to iterate over an ArrayList ...READ MORE

3 days ago in Java by Kichu
• 16,850 points
5 views
0 votes
0 answers

Could not connect to SMTP host: smtp.gmail.com, port: 465, response: -1

I am getting this error when I ...READ MORE

6 days ago in Java by Kichu
• 16,850 points
16 views
0 votes
0 answers

could not extract ResultSet in hibernate

I am getting this exception: "HTTP Status ...READ MORE

6 days ago in Java by Kichu
• 16,850 points
14 views
0 votes
0 answers

keytool error Keystore was tampered with, or password was incorrect

When I generate certificates on my local ...READ MORE

6 days ago in Java by Kichu
• 16,850 points
19 views
0 votes
0 answers

What is a IOException, and how do I fix it?

What is causing java.io.IOException? What does it ...READ MORE

6 days ago in Java by Kichu
• 16,850 points
8 views
0 votes
0 answers

Editor does not contain a main type in Eclipse

I have 64-bit ubuntu where I downloaded ...READ MORE

May 19 in Java by Kichu
• 16,850 points
24 views
0 votes
0 answers

Getting java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory exception

I am getting this exception when I ...READ MORE

May 18 in Java by Kichu
• 16,850 points
23 views
0 votes
0 answers

java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)

This is the exception on getConnection(): java.sql.SQLException: Access denied ...READ MORE

May 16 in Java by Kichu
• 16,850 points
98 views
0 votes
0 answers

java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 exception

I am getting the error java.lang.IndexOutOfBoundsException: Index: ...READ MORE

May 17 in Java by Kichu
• 16,850 points
25 views
0 votes
0 answers

resource : Invocation of init method failed

I am getting this error when I ...READ MORE

May 16 in Java by Kichu
• 16,850 points
28 views
0 votes
0 answers

Can I override and overload static methods in Java?

My questions are: Why can't static methods be ...READ MORE

May 15 in Java by Kichu
• 16,850 points
15 views
0 votes
0 answers

Error java.lang.OutOfMemoryError: GC overhead limit exceeded

When I execute my JUnit tests I am getting ...READ MORE

May 15 in Java by Kichu
• 16,850 points
12 views
0 votes
0 answers

What is "String args[]"? parameter in main method Java

I am a beginner in java and ...READ MORE

May 15 in Java by Kichu
• 16,850 points
9 views
0 votes
0 answers

Error occurred during initialization of boot layer FindException: Module not found

I executed this command line: java --module-path bin ...READ MORE

May 13 in Java by Kichu
• 16,850 points
58 views
0 votes
0 answers

java.lang.NumberFormatException: null i

I am getting this error while doing ...READ MORE

May 13 in Java by Kichu
• 16,850 points
20 views
0 votes
0 answers

Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]

I want to configure hibernate ORM mapping ...READ MORE

May 11 in Java by Kichu
• 16,850 points
21 views
0 votes
0 answers

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'MyController':

I am trying to create a spring ...READ MORE

May 9 in Java by Kichu
• 16,850 points
99 views
0 votes
0 answers

Exception in thread "main" java.lang.Error: Unresolved compilation problems

I am facing issues importing classes and ...READ MORE

May 7 in Java by narikkadan
• 7,860 points
141 views
0 votes
0 answers

Spring Maven clean error - The requested profile "pom.xml" could not be activated because it does not exist

I am  getting this message when I ...READ MORE

May 8 in Java by Kichu
• 16,850 points
78 views