Trending questions in Java

+11 votes
12 answers

Default parameters of XMS and XMX in JVM

You use these Java command-line parameters to ...READ MORE

Nov 13, 2018 in Java by Murali
232,742 views
+15 votes
19 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
165,011 views
+8 votes
13 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,580 points
147,886 views
+2 votes
10 answers

How to import a jar file in Eclipse?

To import jar file in your Eclipse ...READ MORE

May 15, 2018 in Java by sharth
• 3,370 points
140,879 views
+2 votes
12 answers

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

this method must be static so that it will exist even though the ...READ MORE

Jun 11, 2019 in Java by Neha
• 330 points
115,737 views
+2 votes
11 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
77,107 views
+1 vote
11 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
68,049 views
+1 vote
11 answers

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

you mysql server instance is not running ...READ MORE

Jun 15, 2019 in Java by Encrypter Manyange
68,675 views
+1 vote
11 answers

How to send HTTP POST requests on Java?

How to invoke Thread dump analysis API? Invoking ...READ MORE

Jun 16, 2019 in Java by Jim
• 810 points

reshown Jun 17, 2019 by Vardhan 56,060 views
0 votes
10 answers

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

The best way is to add the ...READ MORE

Dec 10, 2018 in Java by Nabarupa
54,398 views
0 votes
11 answers

Java - sending HTTP parameters via POST method easily

You can write like this simply get ...READ MORE

1 day ago in Java by anonymous
• 140 points
40,322 views
+1 vote
10 answers

Iterate over a JSONObject?

You can use the following method to ...READ MORE

Dec 7, 2018 in Java by Shuvodip
46,735 views
+2 votes
2 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
• 54,080 points
14,186 views
0 votes
3 answers

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

import java.util.*; public class AmstrongNumber { public static void ...READ MORE

Aug 6, 2019 in Java by anonymous
26,794 views
0 votes
1 answer

How to Install Java in Windows system?

Hi@akhtar, You can follow the below-given steps to install ...READ MORE

1 day ago in Java by MD
• 32,730 points
14 views
0 votes
0 answers

Provider class org.springframework.context.index.processor.CandidateComponentsIndexer not in module

package spring.demo; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; public class Client { public ...READ MORE

4 days ago in Java by DUGASANI
• 120 points
17 views
0 votes
1 answer

GSON fails to read/map a field with name like USERId

Hello @ RamaKrishnaRaju, You should note the Javadoc of configureMessageConverters states ...READ MORE

6 days ago in Java by Niroj
• 33,400 points
39 views
0 votes
1 answer

HttpServletRequest get JSON POST data

Normally you can GET and POST parameters ...READ MORE

Nov 29, 2018 in Java by Sushmita
• 6,890 points
24,316 views
0 votes
1 answer

Error:jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class

Hello @kartik, The servlet API .jar file must ...READ MORE

Jun 3 in Java by Niroj
• 33,400 points
200 views
0 votes
1 answer

How to run a .java file from command line passing arguments in Maven?

Hello @kartik, You could run: mvn exec:exec -Dexec.args="arg1". This will ...READ MORE

Jun 3 in Java by Niroj
• 33,400 points
165 views
0 votes
1 answer

Error:Maven Unable to locate the Javac Compiler in:

Hello @kartik, Go to Window -> Preferences... -> ...READ MORE

Jun 3 in Java by Niroj
• 33,400 points
126 views
0 votes
1 answer

How to install Maven artifact with sources from command line?

Hello @kartik, To download sources for your dependencies: mvn ...READ MORE

Jun 3 in Java by Niroj
• 33,400 points
114 views
0 votes
1 answer

How to redirect to an external URL from controller action in Spring MVC?

Hello @kartik, You can do it with two ...READ MORE

May 22 in Java by Niroj
• 33,400 points
632 views
0 votes
1 answer

How do I configure Maven for offline development?

Hello @kartik, You have two options for this: 1.) ...READ MORE

Jun 3 in Java by Niroj
• 33,400 points
89 views
0 votes
1 answer

Error:The superclass “javax.servlet.http.HttpServlet” was not found on the Java Build Path

Hello @kartik, Include servlet-api-3.1.jar in your dependencies. Maven <dependency> ...READ MORE

Jun 3 in Java by Niroj
• 33,400 points
80 views
0 votes
1 answer

Error:java.lang.OutOfMemoryError: Java heap space in Maven

Hello @kartik, Here is the whole config that ...READ MORE

Jun 3 in Java by Niroj
• 33,400 points
69 views
0 votes
1 answer

Error:“java.lang.OutOfMemoryError: PermGen space” in Maven build

Hello @kartik, When you increased MAVEN_OPTS, you increase the MaxPermSize, ...READ MORE

Jun 3 in Java by Niroj
• 33,400 points
45 views
0 votes
1 answer

How to configure encoding in Maven?

Hello @kartik, I use some reporting plugins. In ...READ MORE

Jun 3 in Java by Niroj
• 33,400 points
43 views
0 votes
1 answer

Error: setOnItemClickListener cannot be used with a spinner

Hello @kartik, See the first line of your ...READ MORE

Jun 1 in Java by Niroj
• 33,400 points
74 views
0 votes
1 answer

Can edureka has portals to teach ?

Hi, @Dhanush, Regarding your query, I would suggest you ...READ MORE

Jun 1 in Java by Gitika
• 31,390 points
34 views
0 votes
1 answer

Gradle - Error Could not find method implementation() for arguments

Hello @kartik, Make sure your gradle version 3.. or ...READ MORE

May 26 in Java by Niroj
• 33,400 points
287 views
0 votes
1 answer

IllegalArgumentException: navigation destination xxx is unknown to this NavController

Hello @kartik, Check currentDestination before calling navigate might be helpful. For ...READ MORE

May 26 in Java by Niroj
• 33,400 points
236 views
+1 vote
3 answers

How to take input using BufferedReader in Java?

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

Feb 1 in Java by Rohan
• 180 points
12,269 views
0 votes
1 answer

How can I create an executable JAR with dependencies using Maven?

Hello @kartik, You can use the dependency-plugin to ...READ MORE

May 28 in Java by Niroj
• 33,400 points
103 views
0 votes
1 answer

How to get the current working directory in Java?

Hello, Using java.nio.file.Path and java.nio.file.Paths, you can do the following to ...READ MORE

May 28 in Java by Niroj
• 33,400 points
89 views
0 votes
1 answer

Error: 'android.os.NetworkOnMainThreadException'?

Hello, I solved this problem using a new Thread. Thread ...READ MORE

May 28 in Java by Niroj
• 33,400 points
68 views
0 votes
1 answer

Android Studio Gradle project “Unable to start the daemon process /initialization of VM”

Hello, The Solution Worked: 1.Open the projects gradle.properties file in android ...READ MORE

May 26 in Java by Niroj
• 33,400 points
143 views
0 votes
1 answer

What is a serialVersionUID and why should we use it?

Hello @kartik, SerialVersionUID is a unique identifier for each ...READ MORE

May 28 in Java by Niroj
• 33,400 points
61 views
0 votes
1 answer

How to set base url for rest in spring boot?

Hello @kartik, Set it up in your application.yml ...READ MORE

May 22 in Java by Niroj
• 33,400 points
298 views
0 votes
1 answer

Error: getExtractedText on inactive InputConnection warning on android

Hello @kartik, The warning appeared when the soft ...READ MORE

May 26 in Java by Niroj
• 33,400 points
105 views
0 votes
1 answer

Error:No EntityManager with actual transaction available for current thread - cannot reliably process 'persist' call

Hii @kartik, If you have @Transactional // Spring Transactional class ...READ MORE

May 22 in Java by Niroj
• 33,400 points
279 views
0 votes
1 answer

How to parse JSON Array in Android?

Hello @kartik, use the following snippet to parse ...READ MORE

May 26 in Java by Niroj
• 33,400 points
76 views
0 votes
1 answer

How to get a context in a recycler view adapter?

Hii, You can add global variable: private Context context; then ...READ MORE

May 26 in Java by Niroj
• 33,400 points
69 views
0 votes
1 answer

What is the equivalent to a JavaScript setInterval/setTimeout in Android/Java?

Hii @kartik, As always with Android there's lots ...READ MORE

May 26 in Java by Niroj
• 33,400 points
66 views
0 votes
1 answer

How to convert InputStream to byte array in Java?

Hello @kartik, You need to read each byte ...READ MORE

Apr 9 in Java by Niroj
• 33,400 points
2,083 views
0 votes
1 answer

How to unzip files programmatically in Android?

Hello @kartik, This is my unzip method, which ...READ MORE

May 25 in Java by Niroj
• 33,400 points
90 views
0 votes
1 answer

How can one detect airplane mode on Android?

Hello, When registering the Airplane Mode BroadcastReceiver (@saxos answer) I ...READ MORE

May 26 in Java by Niroj
• 33,400 points
44 views
0 votes
1 answer

How to import android project as library and NOT compile it as apk?

Hello, In projLib's build.gradle file, you'll see a statement ...READ MORE

May 26 in Java by Niroj
• 33,400 points
41 views
0 votes
1 answer

How to launch Google Maps Directions via an intent on Android?

Hello @kartik, If you are interested in showing the ...READ MORE

May 25 in Java by Niroj
• 33,400 points
81 views
0 votes
1 answer

Error:Unable to execute dex: Multiple dex files define

Hello @kartik, The Solution for me was just ...READ MORE

May 25 in Java by Niroj
• 33,400 points
43 views