Can anyone tell what happens in case of JDK's while we write code and save the file to run the application. Where and when will the .class file for my code get generated?
Asked
Active
Viewed 85 times
-3
-
It's called "compilation" – Stultuske May 06 '15 at 07:05
-
See [About the Java Technology](https://docs.oracle.com/javase/tutorial/getStarted/intro/definition.html) in Oracle's Java Tutorials. This explains what source files and class files are and how they are used. – Jesper May 06 '15 at 07:06
-
Eclipse is not a JDK. It's IDE. – Tagir Valeev May 06 '15 at 07:12
3 Answers
4
Inside your project, a bin folder will be created and inside the bin folder, you will have your .class
files. class
files will be created when your code is compiled.

TheLostMind
- 35,966
- 12
- 68
- 104
1
When you click "run" or "build" in eclipse, the compiler will generate the .class
files which contain your compiled code. They will be in the /bin/
folder of your project.

Jonas Czech
- 12,018
- 6
- 44
- 65
-
But in eclipse the compilation happens in synch when we write the codes so will the .class file be generated then itself? or does it require us to build it first? – Abhilash28 May 06 '15 at 07:21
-
@abhilash, No, Eclipse does [not compile as you type](http://stackoverflow.com/a/7677183/4428462), although you can set it it to automatically build on save. In that case, `.class` file will be generated on save. – Jonas Czech May 06 '15 at 07:32
-
0
When you will compile your code the .class
will be created in the bin
folder.
On a side note: Eclipse is automatically compiling your code and this option can be disabed by un-checking the build automatically in Project menu

Rahul Tripathi
- 168,305
- 31
- 280
- 331
-
-
@OO7:- When I started writing I didnt see that it has been answered, Thanks! – Rahul Tripathi May 06 '15 at 07:09