Eclipse save automatically

EclipseIdeAutosave

Eclipse Problem Overview


I would like Eclipse to automatically save every time I edit a file, in much the same way that it builds automatically. Because I've been using IntelliJ for the last year (which saves automatically by default), I keep having the following problem:

  • Make some changes in Eclipse
  • Forget to press save
  • Run the build, unit tests, and notice some strange behaviour
  • (Some time later....) realize that the unexpected behaviour occurred because I forgot to save the changes

Is there any way I can make Eclipse save automatically?

Eclipse Solutions


Solution 1 - Eclipse

Eclipse Neon (4.6)

Window > Preferences

Window Preferences

General > Editors > Autosave > check Enable autosave for dirty editors > choose the value for autosave interval (in seconds)

General Editors Autosave

Details in M7:

> Auto-save of dirty editors is now available in Eclipse. The autosave option is disabled by default. A new autosave preference page (Preferences > General > Editors > Autosave) is available and allows to enable/disable the autosave and change the interval of autosave. The countdown is reset on keyboard activity, mouse click, or when a popup is displayed (e.g. content assist, preference page, ...).

Solution 2 - Eclipse

You can go here and check the box Save automatically before build

Windows > Preferences > General -> Workspace

Solution 3 - Eclipse

First, try Window -> Preferences -> General -> Workspace. There you can check "Save automatically before build" and "Build automatically."

If that does not work,

PLEASE TRY

> Preferences -> Run/Debug -> Launching -> "Save dirty editors before > launching"

Solution 4 - Eclipse

You can do it with the saveDirtyEditor plugin as referenced in this question/answer. There is no non-plugin way of doing it.

Solution 5 - Eclipse

I wrote an Eclipse plugin for this called smartsave. It's available in the Eclipse Market Place.

It saves your files at a specified interval and you can even tune it to prevent saving if errors, or warnings, are present in the preferences dialog.

Solution 6 - Eclipse

In Helios this can be done by going to preferences and setting:

> Run/Debug > Launching > Save required dirty editors before launching

Solution 7 - Eclipse

For Eclipse Mars 2, the settings are below Window > Preferences > General > Workspace. These settings are in minutes and not in seconds.

enter image description here

Solution 8 - Eclipse

You could go to Windows > Preferences > Autosave and set the auto intervals to 1.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionDónalView Question on Stackoverflow
Solution 1 - EclipseROMANIA_engineerView Answer on Stackoverflow
Solution 2 - EclipseGuruKulkiView Answer on Stackoverflow
Solution 3 - EclipseUmAnusornView Answer on Stackoverflow
Solution 4 - EclipseNick FortescueView Answer on Stackoverflow
Solution 5 - EclipsemystilleefView Answer on Stackoverflow
Solution 6 - EclipseAnthonyWView Answer on Stackoverflow
Solution 7 - EclipseTatkalView Answer on Stackoverflow
Solution 8 - EclipseJasbin karkiView Answer on Stackoverflow