Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/343.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
grunt htmlcompressor失败错误找不到java_Java_Visual Studio_Gruntjs - Fatal编程技术网

grunt htmlcompressor失败错误找不到java

grunt htmlcompressor失败错误找不到java,java,visual-studio,gruntjs,Java,Visual Studio,Gruntjs,在visual studio 2015中运行grunt任务htmlcompressor时, 任务返回 >错误:错误:找不到:java 警告:htmlcompressor无法压缩html。使用--force继续。 由于警告而中止。 进程以代码6终止。 任务代码: htmlcompressor: { compile: { files: [{ expand: true, // Enable dynamic expansi

在visual studio 2015中运行grunt任务htmlcompressor时, 任务返回
>错误:错误:找不到:java
警告:htmlcompressor无法压缩html。使用--force继续。
由于警告而中止。
进程以代码6终止。

任务代码:

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
            }
        }
    },

我想你可能遇到了一个老问题

在插件的GitHub repo中有一个已解决的问题,其中包括将
路径
环境更新为
java.exe
的解决方法。有关更多信息,请参阅最后一篇文章。内容如下:

对于Windows,另一个解决方法是更新“PATH”环境变量buy,将路径添加到“java.exe”,例如: 开始>右键单击“计算机”>属性>高级系统配置>高级选项(选项卡)>环境变量>编辑路径并将路径添加到java.exe C:\Program Files(x86)\java\jre7\bin) 注意:如果有cmd open,请先关闭它,然后再打开,否则将不起作用