Trending questions in Java

+13 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
261,745 views
+9 votes
14 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
216,979 views
+15 votes
22 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
193,820 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
174,509 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
146,220 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
101,518 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
89,312 views
+1 vote
12 answers

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

I had the same problem.then i did ...READ MORE

Aug 15 in Java by Bhuvana
83,877 views
0 votes
11 answers

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

You can also create a "lib" folder ...READ MORE

Jul 17 in Java by Zeenu
73,167 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 75,808 views
0 votes
11 answers

Java - sending HTTP parameters via POST method easily

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

Jul 7 in Java by anonymous
• 140 points
55,762 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
58,355 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
43,335 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
• 58,130 points
23,298 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
21,030 views
+1 vote
2 answers

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

Try this in case you don't know ...READ MORE

Aug 29, 2019 in Java by Sirajul
• 58,130 points
23,498 views
0 votes
2 answers

How to convert InputStream to byte array in Java?

The class IOUtils, lib: https://mvnrepository.com/artifact/com ...READ MORE

Sep 23 in Java by Anthony
6,397 views
0 votes
1 answer

Could not include JAR files

Hey, @Boopathy, Which command do you use to ...READ MORE

2 days ago in Java by Gitika
• 42,520 points
38 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
30,171 views
0 votes
1 answer

how to serially execute selenium maven project?

Hi, @Beigi, Do check you have all the ...READ MORE

3 days ago in Java by Nisha
17 views
0 votes
1 answer

Can i know where is java logs on centos 7?

Hey! Have you checked <user.home>/.java/deployment/log ? READ MORE

Oct 19 in Java by Kiya
21 views
0 votes
1 answer

Java replace : replace all charecters with space except the matched string like "test"

Hi, @jyra, You can go through this example:  String ...READ MORE

Oct 14 in Java by Gitika
• 42,520 points
30 views
0 votes
2 answers

I want list of date of every week based on pass dynamically "Mon ,Tue, Wed, Thu, Fri, Sat, Sun" between startDate and endDate using Java 8 LocaleDate

public List<LocalDate> getWeeklyDateByStringofDays(String daysOfWeek, LocalDate startDate, ...READ MORE

Sep 14 in Java by anonymous
• 190 points
115 views
0 votes
0 answers

How to store and fetch nested json data from dynamodb in java

I want to maintain a book library. ...READ MORE

Sep 7 in Java by saswat
• 120 points

edited Sep 7 by Gitika 290 views
0 votes
3 answers

How to clear the console in Java?

import java.io.IOException; public class chkClearScreen {     public static void ...READ MORE

Aug 26 in Java by ItsJustRaja
18,360 views
0 votes
1 answer

how to get cache memory size of a application in android

To find the size of the cache ...READ MORE

Sep 4 in Java by Rajiv
• 3,400 points
99 views
0 votes
1 answer

How to set path if java is installed in E drive or D drive rather than c

Hello, @Amazing, It doesn't really matter where you ...READ MORE

Sep 1 in Java by Roshni
• 4,810 points
72 views
+5 votes
3 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 6, 2018 by Omkar 31,882 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
• 68,600 points
4,188 views
0 votes
0 answers

I need to Post api to database using java in intellij. After testing sample api through postman i got an Sql exception saying Syntax error at or near ',' Please tell me where i made a mistake

public Result setModelMasterParams(){         try{             long tenantId = request().getHeader("tenant_id")==null                     || request().getHeader("tenant_id").equalsIgnoreCase("")                     || ...READ MORE

Aug 19 in Java by Sriram
• 120 points

recategorized Aug 19 by Niroj 329 views
0 votes
2 answers

How to log SQL statements in Spring Boot?

HI.. try using this in your properties file: logging.level.org. ...READ MORE

Sep 24 in Java by SRI

edited Sep 24 by Sirajul 948 views
0 votes
0 answers

Restsharp support webservice automationtesting like rest

Hi , Restsharp support webservice automationtesting like rest ...READ MORE

Aug 9 in Java by anonymous
• 2,970 points
269 views
0 votes
1 answer

Error:serializable class Foo does not declare a static final serialVersionUID field of type long

Hello @kartik, If you're serializing just because you ...READ MORE

Jul 28 in Java by Niroj
• 68,600 points
516 views
0 votes
0 answers

Trying to avoid detection using selenium chrome driver (Java)

I am trying to do an automated ...READ MORE

Jul 14 in Java by laiman
• 330 points
942 views
0 votes
1 answer

How to add local jar files to a Maven project?

Hello @kartik, You can add local dependencies directly ...READ MORE

Jul 28 in Java by Niroj
• 68,600 points
166 views
0 votes
1 answer

Error:The method must override a superclass method after importing a project into Eclipse

Hello @kartik, This problem happened when I imported ...READ MORE

Jul 28 in Java by Niroj
• 68,600 points
133 views
0 votes
1 answer

How to use an existing database with an Android application?

Hello @kartik, If you are having pre built ...READ MORE

Jul 28 in Java by Niroj
• 68,600 points
107 views
0 votes
1 answer

Error:java.lang.UnsupportedClassVersionError: Unsupported major.minor version

Hello @kartik, This error means you're trying to ...READ MORE

Jul 28 in Java by Niroj
• 68,600 points
105 views
0 votes
1 answer

How to get an enum value from a string value in Java?

Hello @kartik, Yes, Blah.valueOf("A") will give you Blah.A. Note that the name ...READ MORE

Jul 28 in Java by Niroj
• 68,600 points
104 views
0 votes
1 answer

How can I get the current stack trace in Java?

Hello @kartik, Try this: Thread.currentThread().getStackTrace(); is fine if you don't ...READ MORE

Jul 28 in Java by Niroj
• 68,600 points
72 views
0 votes
1 answer

How do I convert a String to an int in Java?

Hello @kartik, We can use the parseInt(String str) method of ...READ MORE

Jul 28 in Java by Niroj
• 68,600 points
75 views
0 votes
1 answer

How to directly initialize a HashMap?

Hello @Kartik, In plain java 8 you also ...READ MORE

Jul 28 in Java by Niroj
• 68,600 points
67 views
0 votes
1 answer

How to create a memory leak in Java?

Hello @kartik, A simple thing to do is ...READ MORE

Jul 28 in Java by Niroj
• 68,600 points
51 views
0 votes
1 answer

How to avoid Java code in JSP files?

Hello @kartik, JSTL offers tags for conditionals, loops, sets, ...READ MORE

Jul 28 in Java by Niroj
• 68,600 points
48 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
• 68,600 points
2,833 views
0 votes
1 answer

Get sub-string from text based on certain conditions/rules

Hello @laiman, You can use IsMatch function that tests whether ...READ MORE

Jul 28 in Java by Niroj
• 68,600 points
77 views
+2 votes
2 answers

Using while loop i want to print 10 even numbers

public class Loops { ...READ MORE

Dec 4, 2019 in Java by One of the Simplest ways to answer you q
18,055 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
• 68,600 points
2,466 views
0 votes
2 answers

“Cannot find symbol” compilation error

The "Cannot find symbol" errors generally occur when you ...READ MORE

Apr 3, 2019 in Java by patricblues
• 140 points
27,046 views
0 votes
1 answer

if i given invalid data how to get alert in selenium using java

Hello, Here is some of the method you ...READ MORE

Jul 20 in Java by Niroj
• 68,600 points
109 views