Node.js之eclipse集成开发环境(2)

 1.插件官方网站 http://www.nodeclipse.org/updates/  

2.确认已安装jdk和eclipse

3.启动eclipse ---> help -->install new software 

地址输入:
http://www.nodeclipse.org/updates/

插件选择:

图片



点击下一步  直到完成! 然后重启eclipse

就会发现多了一个Node.js的选择项如下图

图片



图片
注意:运行时出现NodeEclipse版本为0.17.0.xxx对应jdk的版本一定为1.7
如果是NodeEclipse 版本为0.16.xxxx则对应jdk的版本为1.6 

提示:如果出现在eclipse中运行出现一闪而过,而nodejs的运行没有保持的情况,请注意jdk的更换,


另外如果提示:Debug的时候出现:  Failed to connect to Standalone V8 VM
请安装 http://chromedevtools.googlecode.com/svn/update/dev/
另外如果提示安装超时,请修改本地hosts文件: host文件末尾加入  74.125.20.31 chromedevtools.googlecode.com 
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Spring Boot 是一个 Java Web 开发框架,而 Node.js 是一个 JavaScript 运行环境,两者并不直接相关。如果你想在 Spring Boot 项目中使用 Node.js,可以考虑使用 Spring Boot 的集成方式,例如使用 Spring Boot 的 Process API 来启动 Node.js 进程,并与其进行交互。 具体步骤如下: 1. 在 Spring Boot 项目中添加 Node.js 的依赖,例如使用 Maven,可以在 pom.xml 文件中添加以下依赖: ```xml <dependency> <groupId>com.eclipsesource.j2v8</groupId> <artifactId>j2v8</artifactId> <version>4.8.0</version> </dependency> ``` 2. 编写 Java 代码来启动 Node.js 进程,并与其进行交互,例如: ```java import com.eclipsesource.v8.V8;import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class NodeRunner { public static void main(String[] args) throws IOException { // 启动 Node.js 进程 Process process = Runtime.getRuntime().exec("node app.js"); // 获取 Node.js 进程的输入输出流 BufferedReader input = new BufferedReader(new InputStreamReader(process.getInputStream())); BufferedReader error = new BufferedReader(new InputStreamReader(process.getErrorStream())); // 读取 Node.js 进程的输出信息 String line; while ((line = input.readLine()) != null) { System.out.println(line); } // 读取 Node.js 进程的错误信息 while ((line = error.readLine()) != null) { System.err.println(line); } // 等待 Node.js 进程结束 try { int exitCode = process.waitFor(); System.out.println("Node.js process exited with code " + exitCode); } catch (InterruptedException e) { e.printStackTrace(); } } } ``` 3. 在 Spring Boot 项目中调用 NodeRunner 类的 main 方法即可启动 Node.js 进程。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值