Q:

grunt htmlcompressor failed Error not found java

in visual studio 2015 when running grunt task htmlcompressor, 
the task returns 
>> Error: Error: not found: java
Warning: htmlcompressor failed to compress html. Use --force to continue.
Aborted due to warnings.
Process terminated with code 6.
the task code:
htmlcompressor: {
        compile: {

            files: [{
                expand: true,     // Enable dynamic expansion.
                cwd: 'Scripts/Ng-Views/',      // Src matches are relative to this path.
                src: ['**/*.html'], // Actual pattern(s) to match.
                dest: 'wwwroot/Views/',   // Destination path prefix.
            }],

            options: {
                type: 'html',
                preserveServerScript: true
            }
        }
    },

A:

I think you may be encountering an old issue with grunt-htmlcompressor.
In the GitHub repo for the plugin there is a closed issue that includes a workaround for updating PATH environment to java.exe. See the last post here for further info. It reads:

For Windows another workaround will be update "PATH" environment variable buy adding the path to "java.exe", for example: 
  Start> Right click on "Computer"> Properties> Advanced system configuration> Advanced options (tab)> Enviroment vars> Edit PATH and add path to java.exe C: \ Program Files (x86) \ Java \ jre7 \ bin)
  NOTE: If you have cmd open, close it and open it again, otherwise will not work.

