Most voted questions in Java

+28 votes
3 answers

How can we set java.library.path in Eclipse?

Go into the library settings for your ...READ MORE

Jul 3, 2018 in Java by sharth
• 3,330 points
1,948 views
+15 votes
18 answers

How can I convert String to JSON object in Java?

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

Feb 7 in Java by Suresh
• 700 points
83,336 views
+12 votes
3 answers

How do I set or change the PATH system variable?

First make sure you have installed JDK ...READ MORE

Aug 28, 2018 in Java by slayer
• 29,170 points
100 views
+9 votes
11 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,540 points
38,439 views
+7 votes
11 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
114,327 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,380 points

edited Nov 6, 2018 by Omkar 9,119 views
+4 votes
1 answer

How to print the individual occurance of elements in Java?

You can use a HashMap to serve ...READ MORE

Dec 4, 2018 in Java by Priyaj
• 56,900 points
108 views
+4 votes
3 answers

What are the steps to set Java_home on Windows?

Set Java Home JAVA_HOME = C:\Program Files\Java\jdk1.7.0 [Location ...READ MORE

Sep 18, 2018 in Java by Sushmita
• 6,880 points
122 views
+2 votes
0 answers

How to add external Jar in modular JavaFX 11 project correctly?

I'm using Java 11 and JavaFX 11. ...READ MORE

Aug 8 in Java by invzbl3
119 views
+2 votes
1 answer

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 in Java by Sirajul
• 30,140 points
376 views
+2 votes
1 answer

How to import an existing x509 certificate and private key in Java keystore to use in SSL?

keytool does not provide such basic functionality ...READ MORE

Dec 19, 2018 in Java by Daisy
• 8,050 points
299 views
+2 votes
1 answer

How do I ask the Selenium-WebDriver to wait for few seconds in Java?

There are two ways to wait: explicit ...READ MORE

Dec 19, 2018 in Java by Daisy
• 8,050 points

edited Dec 19, 2018 by Daisy 62 views
+2 votes
1 answer

What is the meaning of "this" keyword in Java?

public class MyThisTest { private int ...READ MORE

Oct 10, 2018 in Java by Daisy
• 8,050 points
55 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 in Java by Neha
• 330 points
52,438 views
+2 votes
10 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
24,908 views
+2 votes
10 answers

Convert Java Byte Array - String - Byte Array

Character Stream Vs Byte Stream Character oriented are ...READ MORE

Sep 25, 2018 in Java by carldivin
• 180 points
3,380 views
+2 votes
10 answers

How to import a jar file in Eclipse?

Go to your project right click and ...READ MORE

Dec 10, 2018 in Java by Hola77
61,396 views
+1 vote
0 answers

output occurs but invisible immediately how to rectify this ?

public class evenodd { public static void main(String[] ...READ MORE

18 hours ago in Java by BIPLAB
• 130 points
8 views
+1 vote
1 answer

Adding Jar file to project

Changing the JRE System Library might work.  Right-click ...READ MORE

Sep 4 in Java by Esha
40 views
+1 vote
1 answer

Java: Nested Methods

JAVA does not support “directly” nested methods, but you ...READ MORE

Aug 20 in Java by Sirajul
• 30,140 points
75 views
+1 vote
0 answers

Initially autowired object has value,it becomes null after paging(using JSF 2.2 and spring 4.01.)

i'm trying to create basic crud operations ...READ MORE

Jul 5 in Java by swats
85 views
+1 vote
1 answer

Can you please explain the difference between string, string buffer and string builder?

String are immutable where as StringBuffer and ...READ MORE

Jul 4 in Java by Akash
• 160 points
81 views
+1 vote
0 answers

How to install java on linux operating system? [closed]

I read good info about java here ...READ MORE

May 16 in Java by Vicky

closed May 16 by Vardhan 30 views
+1 vote
1 answer

What are the types of memory in JVM?

The different types of Memory in JVM ...READ MORE

Mar 7 in Java by Priyaj
• 56,900 points
317 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 in Java by Sirajul
• 30,140 points
2,980 views
+1 vote
4 answers

What is difference between access modifier and access specifier in java

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

Feb 14 in Java by Priyaj
• 56,900 points
4,782 views
+1 vote
2 answers

What is coercion in Polymorphism?

Implicit type conversion is called coercion polymorphism. ...READ MORE

Jun 25 in Java by anonymous
156 views
+1 vote
1 answer

How can I find memory usage of my application in Android?

You can get memory info programmatically and ...READ MORE

Jan 10 in Java by Sushmita
• 6,880 points
61 views
+1 vote
2 answers

What is an Object?

Hey @preetiagarwal, your description is an answer ...READ MORE

Dec 24, 2018 in Java by Priyaj
• 56,900 points
46 views
+1 vote
2 answers

How to use try & catch block in Java?

Hey @Jino, Using try catch block for your ...READ MORE

Dec 21, 2018 in Java by Nabarupa
53 views
+1 vote
1 answer

What are REST clients for Java?

These are the few options : Apache CXF has ...READ MORE

Nov 21, 2018 in Java by Frankie
• 9,810 points
66 views
+1 vote
1 answer

Error: JDWP Unable to get JNI 1.2 environment, jvm->GetEnv() return code = -2

Hello @Jino, It is just a JVM bug ...READ MORE

Nov 21, 2018 in Java by Nabarupa
947 views
+1 vote
1 answer

Maximum memory usage for JVM

I guess, you can try using the ...READ MORE

Nov 13, 2018 in Java by 93.lynn
• 1,560 points
45 views
+1 vote
1 answer

How do I do a HTTP GET?

If you don't want to use external ...READ MORE

Aug 28, 2018 in Java by Neha
• 6,280 points
22 views
+1 vote
1 answer

What is a simple way to repeat a string in java?

From Java 11 on, there's a method String::repeat that does ...READ MORE

Aug 28, 2018 in Java by Frankie
• 9,810 points
479 views
+1 vote
1 answer

How to calculate days between two dates?

You are making some conversions with your ...READ MORE

Aug 28, 2018 in Java by Frankie
• 9,810 points
50 views
+1 vote
1 answer

Convert CSV to JSON. JSON payload should be included in square brackets

The JSON payload uses a list and ...READ MORE

Aug 6, 2018 in Java by Omkar
• 67,620 points
1,571 views
+1 vote
1 answer

What is the difference between JavaScript and Java

This quote rightly explains that 2 totally ...READ MORE

Jun 29, 2018 in Java by Daisy
• 8,050 points
40 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
16,396 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 in Java by Encrypter Manyange
24,542 views
+1 vote
1 answer

How to tell the Maven to use the latest version of dependency in Java?

If you always want to use the ...READ MORE

Jun 26, 2018 in Java by Sushmita
• 6,880 points
1,791 views
+1 vote
2 answers

Is there a code to find 64-bit JVM or 32-bit JVM (from within a program)?

Do I need to understand the difference ...READ MORE

Jun 11 in Java by Jim
• 810 points
267 views
+1 vote
10 answers

How to make mock to void methods with mockito

You can use partial mocking to serve ...READ MORE

Dec 7, 2018 in Java by nitesh
9,769 views
+1 vote
10 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
19,661 views
+1 vote
2 answers

Calculating date/time difference in Java

We can also use java.util.concurrent.TimeUnit class. long diff = d2.getTime() ...READ MORE

Aug 28, 2018 in Java by Sushmita
• 6,880 points
530 views
+1 vote
10 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
4,669 views
+1 vote
1 answer

How to fix java.lang.UnsupportedClassVersionError: Unsupported major.minor version

This error means you're trying to load ...READ MORE

Jun 8, 2018 in Java by Rishabh
• 3,540 points
894 views
+1 vote
1 answer

How can we resolve java.lang.OutOfMemoryError in Java?

Work with smaller batches of HashMap Objects ...READ MORE

Jun 5, 2018 in Java by sharth
• 3,330 points
78 views
+1 vote
2 answers

Can I convert my Java program to an .exe file?

Launch4j is a cross-platform tool for wrapping ...READ MORE

Oct 18, 2018 in Java by Sushmita
• 6,880 points
102 views