I am writing a large program, with some use of Maven to manage dependencies, and have come across the issue that running Pi4J causes
/dev/mem to be opened, which, of course, cannot be done by a non-root user. I would like to avoid running the application as root for the following reasons:
Running as root will make an inevitable security bug much more damaging than a separate user (equipment connected to GPIOs is not dangerous or damaged by invalid data, so my only concern is running arbitrary commands/code)
Running as root would, especially during development, cause issues with file permissions.
What steps can I take to allow a non-root user to use Pi4J to read and write GPIOs? I would prefer not to use the
/sys/class/gpio API unless there is a ready library for it.