I install Java on all my machines and used to add the java path and home variables to the user (or my user) bash profile but every time I added another user this is a manual step.
Until I found this small trick. Add a system wide profile path setting by creating a file in:
All files in profile.d are added to every users login. Much cleaner than adding it to every user’s profile.
This is the contents of my file:
These variables are set next time you log in with any user on that system.