在IDE中运行Vertx [英] Run Vertx in an IDE

查看:464
本文介绍了在IDE中运行Vertx的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法从IDE中运行Vertx?我知道我可以在文件中创建一个服务器,然后调用

  vertx run server.java 

从命令行,但是有没有办法从IDE中运行server.java文件?

解决方案


  • 创建一个maven项目作为手册说。


  • 然后将项目导入为Maven项目


  • p>使用主类创建一个新的启动器(Eclipse)




    • 对于Vert.x 2.x: org.vertx .java.platform.impl.cli.Starter

    • 对于Vert.x 3.x: io.vertx.core.Starter


  • 在程序参数选项卡中键入:运行your.package.ServerVerticle -conf conf.json




如果你没有使用 conf.json 有一个,这只是一个例子,告诉你,你可以放在那里呃选项你可以从命令行启动Vert.x。



PRO TIP:如果你的垂直线是用其他语言编写的,请使用具有如下语言名称的前缀:




  • 运行scala:com.acme.MainVerticle -conf conf.json

  • 运行jython:MainVerticle.py -conf conf.json

  • 运行jruby:MainVerticle.rb -conf conf.json

  • 运行犀牛:MainVerticle.js -conf conf.json

  • 运行groovy:MainVerticle.groovy -conf conf.json



等等。


Is there any way to run Vertx from within an IDE? I know I can create a server in a file and then call

vertx run server.java

from the command line, but is there a way to run the server.java file from within an IDE?

解决方案

  • create a maven project as the manual says.

  • Then import the project as Maven project

  • Create a new launcher (Eclipse) using as main class

    • For Vert.x 2.x: "org.vertx.java.platform.impl.cli.Starter"
    • For Vert.x 3.x: "io.vertx.core.Starter"
  • In the tab "Program Arguments" type: "run your.package.ServerVerticle -conf conf.json"

You can omit the conf.json if you don't have one, it's just an example to show you that you can put there any other option you'd put launching Vert.x from the command line.

PRO TIP: if your verticle is written in another language, use the prefix with the name of the language as follows:

  • "run scala:com.acme.MainVerticle -conf conf.json"
  • "run jython:MainVerticle.py -conf conf.json"
  • "run jruby:MainVerticle.rb -conf conf.json"
  • "run rhino:MainVerticle.js -conf conf.json"
  • "run groovy:MainVerticle.groovy -conf conf.json"

And so forth.

这篇关于在IDE中运行Vertx的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆