Setting up IntelliJ 11.1 for Vertx

Hi,

I am having some troubles to run a Java Vertx application from IntelliJ 11 CE.

Basicly what i am trying to achieve is : I want to add a library to the project, but i dont want to add the library to the classpath when running the vertx application.

Does anybody knows how to do this?

Vertx don't want to add the vertx application classes to the classpath. It throws an error like :

SEVERE: Failed to create verticle
java.lang.IllegalStateException: Do not add application classes to the

vert.x classpath


Steps I took..

1. Create a new project from scratch
2. Create a Java Module (JVM based)
3. Src directory
4. Project is created

..

1. In the Project structure I added the Vertx lib jars folder
2. I add a Server.java file containing the Java Hello World example from the homepage of vertx.

.. compile ok!

1. Open up the Run configuration
2. I select the Application configuration
3. I specify the main class as : org.vertx.java.deploy.impl.cli.Starter

4. Program arguments : run src/Server.java
5. use classpath of module .. the only module selectable

.. try running it will throw the following exception:

SEVERE: Failed to create verticle
java.lang.IllegalStateException: Do not add application classes to the
vert.x classpath

Thats true, its added by IntelliJ, i can see it in the run log.

Greetings Rene
1 comment
Comment actions Permalink

This should work if you set the scope of the vert.x library dependency to "provided".

0

Please sign in to leave a comment.