You should definitely try JDBM2, it does what you want:
- Disk backed HashMaps/TreeMaps thus you can iterate through keys.
- Apache 2 license
In addition:
- Fast, very small footprint
- Transactional
- Standalone jar have only 145 KB.
- Simple usage
- Scales well up to 1e9 records
- Uses Java serialization, no ORM mapping
UPDATE
The project has now evolved into MapDB http://www.mapdb.org