Comments (17)
Yes, here are the right command line:
vertx run Server.java -ha -cluster-host 192.168.1.29 -cp ../../../../../../../../target/classes/:/Users/clement/Projects/vert.x/vertx-examples/examples-utils/target/classes
and
vertx bare -cluster-host 192.168.1.29 -cp ../../../../../../../../target/classes/:/Users/clement/Projects/vert.x/vertx-examples/examples-utils/target/classes
not really convenient, will find a different way.
from vertx-examples.
(cluster-host is required on my computer because of my fancy network configuration)
from vertx-examples.
I think for Java examples like this it doesn't really make sense to run them on the command line.
Running in the IDE would be much simpler, so probably just easier to update the README so it talks about running in the IDE only.
from vertx-examples.
Ok, but I need to start a bare instance from the IDE, and then kill a processus started by the IDE.
from vertx-examples.
Just a thought. The main issue in running the Java examples from the command line is that they reference the ExampleRunner class...
Maybe instead of using that class we can use Launcher directly and change Launcher so it looks at vertx.cwd? Then we wouldn't have deps on other classes.
from vertx-examples.
We could also put the logic for cwd that resolves the cwd as I mentioned in another issue so this works seamlessly on Eclipse, NetBeans and IntelliJ?
from vertx-examples.
It would give something like:
// Convenience method so you can run it in your IDE
public static void main(String[] args) {
String exampleDir = "web-examples/src/main/java/" + Server.class.getPackage().getName().replace(".", "/");
try {
// We need to use the canonical file. Without the file name is .
File current = new File(".").getCanonicalFile();
if (exampleDir.startsWith(current.getName()) && ! exampleDir.equals(current.getName())) {
exampleDir = exampleDir.substring(current.getName().length() + 1);
}
} catch (IOException e) {
// Ignore it.
}
Launcher.main(new String[] {
"run",
Server.class.getName(),
"-Dvertx.cwd=" + exampleDir
});
}
WDYT ?
from vertx-examples.
Yes, like that, but I was thinking we should put the adjustment (i.e. the code inside the try..catch block) inside Launcher. Also you wouldn't need the "web-examples/src/main/java" part.
from vertx-examples.
We can do it in Launcher or in a "run-example" command. It would give something like:
Launcher.main(new String[] {
"run-example",
Server.class.getName()
});
It can traverse the file system to find the associated Server.java file and set the vertx.cwd
system property.
from vertx-examples.
I've fixed the HA example, using the Launcher. I've provided the instructions for the IDE and command line.
from vertx-examples.
Perfect
from vertx-examples.
I notice the other examples are still using the ExampleRunner (as reported on a user report in the google group today)
from vertx-examples.
Yes, the ExampleRunner is still used. The "intelligent cwd detection" has been implemented here.
from vertx-examples.
Ah ok. I thought we were going to implement in Launcher (as mentioned in your example above)?
Then the example only has dependencies on core code and is much easier to run without having to depend on ExampleRunner....
from vertx-examples.
Yes, but it was too close to the 3.1 deadline to implement this in the launcher. It will be in 3.2 (it's on my todo list).
from vertx-examples.
It's not the same issue. This one was about running HA which has been fixed. Replacing the ExampleRunner should be another issue (I'm going to create one for this)
from vertx-examples.
Closing this one as the replacement of the ExampleRunner is covered by #97
from vertx-examples.
Related Issues (20)
- About vertx's springboot starter HOT 7
- Upgrade Gradle to latest HOT 1
- Study wether to move large examples to how-tos or remove them
- resteasy-vertx example exception HOT 2
- Build fail in the react example belongs to vertx-web module on RHEL8 with FIPS enabled HOT 1
- vertx-web oauth2 example fails to start HOT 1
- a "Mail Client" question HOT 1
- Vertx MailClient 'createShared' is broken as of 3.x (3.9?). HOT 2
- HttpClient request exception when host is a url HOT 2
- Provide examples of using jdk9 and Java Platform Module System
- I packaged and ran the image through jlink, and the error occurred at startup
- NPE in vertx-redis-client 4.3.0 HOT 1
- Cleaning Pool for Idle Connection
- how to enable tls1.3 and early data for 0RTT HOT 2
- CompositeFuture.join bug
- Remove the adoc description of Groovy verticles from the vertx-core example HOT 1
- About log4j support HOT 3
- how to close log println about [vert.x-eventloop-thread-0] HOT 1
- Event bus codec doesn't work for a list of objet HOT 1
- Missing dependency for "Unresolved plugin: 'com.fizzed:rocker-maven-plugin" in web-example/pom.xml HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vertx-examples.