vertx and IntelliJ IDEA

1858 views
Skip to first unread message

Mihai Cazacu

unread,
Nov 19, 2012, 6:07:45 AM11/19/12
to ve...@googlegroups.com
Hi,

Is there a step-by-step tutorial that helps us to create/run/debug a vert.x (1.3.0.final) project in IntellliJ IDEA?

Thanks,
Mihai

P.S. There is git://github.com/mgutz/vertx-web-hello.git but I can't make it to work with the latest vert.x version.

Mihai Cazacu

unread,
Nov 19, 2012, 4:58:27 PM11/19/12
to ve...@googlegroups.com
@Tim: What IDE do you recommended for running/debugging a vert.x app?

bytor99999

unread,
Nov 19, 2012, 6:34:44 PM11/19/12
to ve...@googlegroups.com
I use IntelliJ. But I haven't tried to set up a run configuration to run vert.x in the IDE. But it should be relatively easy. Personally I build with maven and build and run in a console window, but dev in the IDE. Even about to remote debug through IDE with app running in console.

Mark

Mihai Cazacu

unread,
Nov 20, 2012, 4:01:17 AM11/20/12
to ve...@googlegroups.com

Nikita Pustovoytov

unread,
Apr 18, 2013, 6:48:46 AM4/18/13
to ve...@googlegroups.com
Hello!

I tried to do the same but I get an error:
Error: Could not find or load main class org.vertx.java.deploy.impl.cli.Starter

Vert.x version 1.3.1-final.

вторник, 20 ноября 2012 г., 13:01:17 UTC+4 пользователь Mihai Cazacu написал:

Asher Tarnopolski

unread,
Apr 19, 2013, 6:11:57 AM4/19/13
to ve...@googlegroups.com
take a look at this thread
https://groups.google.com/forum/m/?fromgroups#!searchin/vertx/intellij

I've uploaded a print screen with intellij config there.
although, make sure vertx jars are set as provided and not as compiled in your module settings.

bytor99999

unread,
Apr 24, 2013, 2:22:02 PM4/24/13
to ve...@googlegroups.com
I didn't see anything in that link.

Mark

Asher Tarnopolski

unread,
Apr 24, 2013, 2:42:50 PM4/24/13
to ve...@googlegroups.com

Marco Pas

unread,
May 8, 2013, 5:33:19 AM5/8/13
to ve...@googlegroups.com
Hi Asher, i seem to have the same problem as Nikita, when i put the libraries to provided i get the same error message:

Error: Could not find or load main class org.vertx.java.deploy.impl.cli.Starter
Process finished with exit code 1

Any suggestions on how to fix this?

Tim Fox

unread,
May 8, 2013, 5:34:54 AM5/8/13
to ve...@googlegroups.com
We didn't do any work on IDE integration in Vert.x 1.x which is why you
are having problems.

However, IDE integration in 2.0 is pretty much seamless. Unless you have
an immediate need to use 1.x I'd suggest looking at 2.0

Asher Tarnopolski

unread,
May 8, 2013, 6:27:30 AM5/8/13
to ve...@googlegroups.com
hey,

i was wrong about "provided". 
i created a unified library with all of the jars and added it to my project under "compile" scope. 

hope it helps,
asher

Marco Pas

unread,
May 8, 2013, 6:57:51 AM5/8/13
to ve...@googlegroups.com
Tried your suggestion. Vertx seems to fire up but it gives no response
when accessing the url i am exposing. (simple helloworld)

May 08, 2013 12:56:10 PM org.vertx.java.core.logging.impl.JULLogDelegate warn
WARNING: No language mappings found!

That is all i get

2013/5/8 Asher Tarnopolski <ata...@gmail.com>:
> --
> You received this message because you are subscribed to the Google Groups
> "vert.x" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to vertx+un...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Asher Tarnopolski

unread,
May 8, 2013, 7:23:30 AM5/8/13
to ve...@googlegroups.com
well, if vertx is up and kicking, you are pretty done with intellij idea part and should start taking care on your code :)
i don't know what you mean by "exposing a url". 
within intellij i run a test verticle which deploys my project verticles and sends them messages via eventbus. 

Marco Pas

unread,
May 8, 2013, 7:32:50 AM5/8/13
to ve...@googlegroups.com
I have a verticle which is serving a helloworld.

import org.vertx.java.core.Handler;
import org.vertx.java.core.http.HttpServerRequest;
import org.vertx.java.deploy.Verticle;

public class Server extends Verticle {

public void start() {
System.out.println("test");
vertx.createHttpServer().requestHandler(new
Handler<HttpServerRequest>() {
public void handle(HttpServerRequest req) {
req.response.headers().put("Content-Type", "text/html;
charset-UTF-8");
req.response.end("<html><body><h1>Hello from
vert.x!</h1></body></html>");
}
}).listen(8080);
}

}

When trying to access to url http://localhost:8080 it does not give me
any result.
When running the same class via the command line it works perfect and
i can access the URL.

2013/5/8 Asher Tarnopolski <ata...@gmail.com>:

Asher Tarnopolski

unread,
May 8, 2013, 8:00:51 AM5/8/13
to ve...@googlegroups.com
the code seems fine.
i think your ide doesn't find the compiled verticle it should run.

pay attention that you

1. make your module
2. in run/debug configuration, point working directory to the output path you've defined in your module settings (btw, you can add langs.properties file to your classpath to solve "language not found" or whatever it is problem)
3. choose your intellij module in the "use classpath of module:" drop down menu

give it a try.

cheers,
asher

Marco Pas

unread,
May 8, 2013, 9:21:44 AM5/8/13
to ve...@googlegroups.com
I tried the suggestions, also checked your screenshot and the settings
seemed all ok. I am missing something or intellJ 12 is playing tricks
on me.

2013/5/8 Asher Tarnopolski <ata...@gmail.com>:

Asher Tarnopolski

unread,
May 8, 2013, 9:48:13 AM5/8/13
to ve...@googlegroups.com

I'm still with 11.

Sent from my Nexus 4

You received this message because you are subscribed to a topic in the Google Groups "vert.x" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vertx/chFSsLXyErY/unsubscribe?hl=en-GB.
To unsubscribe from this group and all of its topics, send an email to vertx+un...@googlegroups.com.

Doug Pedrick

unread,
May 9, 2013, 8:37:32 PM5/9/13
to ve...@googlegroups.com

When running it in IntelliJ like this it's necessary to include the vert.x-1.3.1/conf directory in your classpath.  And make sure that the program arguments in the IntelliJ run configuration have the fully qualified verticle class you're trying to execute:  run com.foo.MyClass

Doug

Marco Pas

unread,
May 10, 2013, 4:25:57 AM5/10/13
to ve...@googlegroups.com
You made my day!!! That solved all!! I am wondering how did you get
aware of this being the problem?

2013/5/10 Doug Pedrick <do...@4hrocketry.org>:

Doug Pedrick

unread,
May 10, 2013, 8:15:04 AM5/10/13
to ve...@googlegroups.com
Marco -

I'm glad it worked.  I know how frustrating things like that can be.  I've been running it like this for several months and if I remember correctly I stepped through the debugger in IntelliJ, walking the vertx code and seeing where and why it was failing.  

Doug
Reply all
Reply to author
Forward
0 new messages