I know the question is old, but maybe my answer helps anyone else.
I've found an useful tool (download-link is at the bottom of the page).
With this tool you can adjust your system volume and do many other stuff (for example open your cd-drive). Just download it and put nircmd.exe somewhere on your hard drive. Then write the following to adjust your volume:
Runtime rt = Runtime.getRuntime();
Process pr = rt.exec(pathToNircmdexe + " setsysvolume 32767.5");
This will set your system volume to 50.
To set your volume you will need choose a number between 0 and 65535. If you want to use numbers from 0 to 100 use the method below. It will convert your desired volume (By using simple maths :D)
public void setSystemVolume(int volume)
{
if(volume < 0 || volume > 100)
{
throw new RuntimeException("Error: " + volume + " is not a valid number. Choose a number between 0 and 100");
}
else
{
double endVolume = 655.35 * volume;
Runtime rt = Runtime.getRuntime();
Process pr;
try
{
pr = rt.exec(nircmdFilePath + " setsysvolume " + endVolume);
pr = rt.exec(nircmdFilePath + " mutesysvolume 0");
}
catch (IOException e)
{
e.printStackTrace();
}
}
}
Note: Sadly this only works for windows,
"because Java is cross-platform, it cannot do platform-specific stuff like changing the volume or whatever you want to do to control the OS. You need to use the operating system's unique API layer to do it." source