ArticleDirectory
- 1. Operating System
- 2. JDK
- 3. jruby (optional)
Vert. x Development Guide
Author: chszs, reprinted with note. Blog homepage: http://blog.csdn.net/chszs
I. Introduction
Vert. X is an asynchronous application.ProgramThe development framework can be used to develop asynchronous, scalable, and highly concurrent web applications. The purpose is to provide a node. js alternative solution for JVM. Developers can use JavaScript, Ruby, groovy, Java, or even hybrid languages to write applications.
Using the vertx. x framework, you can use JavaScript, coffeescript, Ruby, Python, groovy, or Java to develop application components. The final application can be built in a hybrid language.
Ii. Conditions of Use 1. Operating System
Vertx. x supports Linux, OSX, and Windows operating systems.
2. JDK
Vertx. X requires JDK 7 or later. You can select Oracle JDK or openjdk.
3. jruby (optional)
If you want to use Ruby to develop applications with vertx. X, you need to install jruby and set the jruby_home environment variable.
Second, you also need to install JSON Ruby gem, because vertx. X will use it. Run:
Jruby-s gem install JSON
Note: This article uses the Ubuntu 13.04 operating system.
Iii. Download and install
The latest stable version is version 1.3.1, version 2.0, or beta2.
Http://vert-x.github.io/vertx-downloads/downloads/vert.x-1.3.1.final.tar.gz
$ Sudo tar zvxf vert.x-1.3.1.final.tar.gz
$ CD Vert. x-1.3.1.final/bin
$./Vertx version
Vert. x-1.3.1.final
Set Environment Variables
$ Export Path = $ path:/home/chszsg/vertx/bin
Iv. Test
Create a file named server. js with the following content:
// Server. jsload ('vertx. js'); vertx. createhttpserver (). requesthandler (function (req) {Req. response. End ("Hello vertx! ");}). Listen (8080, 'localhost ');
Run the following command in the shell environment:
$ Vertx run server. js
Enter the address: http: // localhost: 8080/in the browser/
The result is as follows:
Verify that vert. X works properly!