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
437,957 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
346,448 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
362,472 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
330,181 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
243,071 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,520 points
242,094 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
226,829 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,520 points
211,171 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
203,288 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
177,977 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,520 points
178,178 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
152,670 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,910 points
138,997 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
113,437 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
103,498 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
97,187 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,910 points
103,364 views
0 votes
1 answer

Error creating bean with name 'entityManagerFactory' defined in class path resource : Invocation of init method failed

To solve your ERROR, I would suggest ...READ MORE

Feb 18, 2022 in Java by Aditya
• 7,680 points
63,025 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,520 points
85,958 views
+4 votes
4 answers

Using while loop i want to print 10 even numbers

Hello @Nitesh, you are pretty much there. ...READ MORE

Nov 22, 2018 in Java by Priyaj
• 58,100 points
78,215 views
0 votes
0 answers

UnsatisfiedDependencyException: Error creating bean with name

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

May 21, 2022 in Java by Kichu
• 19,050 points
36,085 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 73,205 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
61,147 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,100 points
57,125 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
62,138 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,230 points
55,975 views
0 votes
1 answer

How to set selected value of jQuery Select2?

The third parameter of the new Option ...READ MORE

May 30, 2022 in Java by gaurav
• 22,970 points
18,691 views
0 votes
1 answer

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'demoRestController'

To answer your doubt, the DemoApplication class ...READ MORE

Feb 23, 2022 in Java by Aditya
• 7,680 points
20,503 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,230 points
49,092 views
0 votes
1 answer

Convert GMT to IST (India Standard Time) using javascript?

You can specify an IANA time zone ...READ MORE

Nov 7, 2022 in Java by Damonlang
• 700 points
7,171 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, 2022 in Java by Kichu
• 19,050 points
11,742 views
+1 vote
3 answers

3 dot in parameter in Java

The "Three Dots" in java is called ...READ MORE

Nov 22, 2018 in Java by geek.erkami
• 2,680 points
48,566 views
0 votes
1 answer

How to decode jwt token in javascript without using a library?

Working unicode text JWT parser function: function parseJwt ...READ MORE

Nov 4, 2022 in Java by Damonlang
• 700 points
2,461 views
0 votes
0 answers

How can I find the prime factors of an integer in JavaScript?

Using a for loop in javascript, I was attempting to determine the prime factors of a number, denoted as 'integer' below.  I can't seem to get it to work, and I'm not sure if it's because of my JavaScript or my calculating logic. //integer is the value for which we ...READ MORE

Dec 12, 2022 in Java by Nicholas
• 7,760 points
342 views
0 votes
0 answers

Generate pdf from HTML in div using Javascript

I have the following HTML code: <!DOCTYPE html> <html> ...READ MORE

Dec 9, 2022 in Java by Nicholas
• 7,760 points
429 views
0 votes
0 answers

Javascript remove background color and opacity

How can I delete the background-color  ...READ MORE

Dec 6, 2022 in Java by Nicholas
• 7,760 points
508 views
0 votes
3 answers

Setting time zone of a java.util.Date

Using Java 8 Java 8 introduced a new Date-Time ...READ MORE

Dec 15, 2020 in Java by Gitika
• 65,910 points
49,913 views
0 votes
0 answers

When to use promise.all()?

What is/are the appropriate scenario(s) for using promise.all() OR Is there a better way to utilize promise.all()?  Should it be used ideally just when all of the promise objects are of the same or comparable type? The only one that comes to mind is: Use promise.all() if you want to resolve the promise only if all of ...READ MORE

Dec 12, 2022 in Java by Nicholas
• 7,760 points
140 views
0 votes
0 answers

Loop over an array in JavaScript

How can I use JavaScript to loop ...READ MORE

Dec 9, 2022 in Java by Nicholas
• 7,760 points
244 views
0 votes
0 answers

Convert a number into a Roman numeral in JavaScript

What is the best way to convert integers to roman numerals? function romanNumeralGenerator (int) { } Consider the following sample inputs and outputs: 1 = "I" 5 = ...READ MORE

Dec 8, 2022 in Java by Nicholas
• 7,760 points
281 views
0 votes
0 answers

How do I get the current time only in JavaScript

In JavaScript, how can I retrieve the ...READ MORE

Dec 9, 2022 in Java by Nicholas
• 7,760 points
201 views
0 votes
0 answers

How to stop timer in javascript?

I'd want to end a timer by clicking a button, but I can't figure out how.  I tried using clearInterval() to halt a timer, but I'm not sure whether it was called correctly. This is my current code. <html> <head> <title>Bootstrap</title> ...READ MORE

Dec 8, 2022 in Java by Nicholas
• 7,760 points
225 views
0 votes
0 answers

Which is better: <script type="text/javascript">...</script> or <script>...</script>

Which is more effective or convenient  ...READ MORE

Dec 9, 2022 in Java by Nicholas
• 7,760 points
128 views
0 votes
0 answers

How to get the current London time and date using javascript

Using the code below, I attempted to& ...READ MORE

Dec 7, 2022 in Java by Nicholas
• 7,760 points
184 views
0 votes
0 answers

JavaScript: undefined !== undefined?

When I first tried to access Facebook API operations after integrating Facebook Connect with Tersus, I received the error messages Invalid Enumeration Value and Handler already exists. It was discovered that the source of the problem was object.x === undefined When there is no property 'x' in 'object,' returns false. I solved the problem by substituting normal equality for rigorous equality in two Facebook functions: FB.Sys.isUndefined = function(o) { return ...READ MORE

Dec 9, 2022 in Java by Nicholas
• 7,760 points
94 views
0 votes
1 answer

Wait until all jQuery Ajax requests are done?

You may need to run certain code ...READ MORE

May 30, 2022 in Java by gaurav
• 22,970 points
8,455 views
0 votes
0 answers

How do I remove an object from an array with JavaScript?

I have a JavaScript object that looks ...READ MORE

Dec 8, 2022 in Java by Nicholas
• 7,760 points
101 views
0 votes
0 answers

How to add days to Date?

How can I add days to the ...READ MORE

Dec 8, 2022 in Java by Nicholas
• 7,760 points
98 views
0 votes
0 answers

Const in JavaScript: when to use it and is it necessary?

In JavaScript, I recently came across the ...READ MORE

Dec 8, 2022 in Java by Nicholas
• 7,760 points
83 views
0 votes
0 answers

How does the "this" keyword work, and when should it be used?

I'm trying to figure out what the&nbs ...READ MORE

Dec 7, 2022 in Java by Nicholas
• 7,760 points
104 views