eclipse less编译时错误处理

来源:互联网 发布:医院数据库使用排名 编辑:程序博客网 时间:2024/05/18 16:13

错误提示:
Cannot be launched because of an I/O exception
Cannot run program “lessc”: error=2, No such file or directory
需要修改less 编译器配置
选中eclipse explore中的less文件,右键-run configuation进入配置对话框。
重新修改options选项中的options中的LESS Command 为lessc的位置
mac下:
/usr/local/bin/lessc
windows下:
C:\Users[Yourname]\AppData\Roaming\npm\lessc.cmd

How to use it?如何使用
Once you have installed the plugin, you just need to create a file with the file extension .less in any project. This file will automatically be opened with the LESS editor.
一旦你安装了这个插件,你需要在你的工程中创建一个.less扩展名的文件,这个文件会被LESS编辑器自动打开

You may register additional file extensions for LESS stylesheets in the Eclipse Preferences (menu Window, then Preferences…), section General > Content Types.
你可以注册其他文件扩展名的的LESS样式文件,操作是Preferences->General > Content Types

You can disable some errors/warnings on a per-project warning, by editing the project properties (tab Validation > LESS.

In order to launch the LESS compiler from Eclipse, you need to create a launch configuration. For this:
less运行配置
In the menu Run, select Run Configurations…

Select LESS Compiler in the list on the left hand side of the dialog, then click on the icon to create a new launch configuration at the top of this list,

Configure the options to run the LESS compiler (in particular the LESS command if lessc is not in your system path) and check the option Use this launch configuration as default.

Once this is done, you may compile any LESS stylesheet by selecting it in the project explorer, clicking on the right button to open the contextual(上下文的) menu and selecting Run as, LESS Compiler. This will use the default launch configuration you just created. You can also create specific launch configurations for each of your stylesheet.
选中一个文件右键选中Run Configurations会弹出一个配置对话框,LESS command的值修改为你lessc所在的位置。注意要确保lessc已经安装在你的系统中

1 0
原创粉丝点击