• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Junilu Lacar
  • Martin Vashko
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Scott Selikoff
  • salvin francis
  • Piet Souris

How does a java source code compile in eclipse ?

 
Ranch Hand
Posts: 386
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I create a new java class in notepad, I have to explicitly compile this class to create class file out of this source java code.
When I craete java classes in eclipse project, do I need to compile these classes OR do they automatically get compiled ? If these classes are compiled by themselves, at what time do they get compiled after finishing coding of class OR when there is no syntax error, this source code creates class file and every time new source code is added, that keeps compiling ?
 
Bartender
Posts: 3648
16
Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In eclipse there is a "Build automatically" under the Project menu. If selected, then the java source will compile automatically.

Explicit compilation is basically done when you export the project to a JAR file or manually select/click "Build". Once build you should able to run the project inside eclipse but I personally don't. I use the jar and run it in the command prompt. Or for web projects deploy the WAR to Tomcat and run it there.
 
Saloon Keeper
Posts: 21306
140
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As long as the auto-compile feature is turned on, Eclipse will re-compile the class each time you save changes to it. Auto-compilation is turned "on" by default.

On large projects, the built-in Eclipse builders aren't sufficient - for example when I need to not only compile, but also to assemble a WAR or EAR. For that level of building, I use Ant or Maven, both of which have plugins allowing them to be controlled within Eclipse. For policy reasons, all my projects can be built on non-GUI (non-Eclipse) machines. In large part because I have been seriously burned by IDEs that had gone obsolete by the time I needed to make emergency repairs to an app. Command-line builders are more stable. Eclipse is my helper, but not my crutch.
 
He repaced his skull with glass. So you can see his brain. Kinda like this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!