-3

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?

Abhilash28
  • 645
  • 1
  • 9
  • 15

3 Answers3

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
  • thanks..its clear now – Abhilash28 May 06 '15 at 09:26
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