Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java: Empty package name is not supported #433

Closed
jvmvik opened this issue Nov 25, 2012 · 4 comments · Fixed by #486
Closed

Java: Empty package name is not supported #433

jvmvik opened this issue Nov 25, 2012 · 4 comments · Fixed by #486
Milestone

Comments

@jvmvik
Copy link

jvmvik commented Nov 25, 2012

I trying to write a real application.
So, I need to write multiple classes and verticles.
Before the migration to 1.3 I was running successfully my application with :
vertx run src/App.java >> 1.2.3 is ok.

now, I get this issue (1.3)

user:~/workspace/vertx.io/java-dashboard$ vertx run src/App.java
Cannot find verticle src/App.java 

I notice that in the java/example every classes has a package name defined.
In my case, the package name must be "src" which doesn't make sense!
When I force this value I can run the verticle.

It will nice to include a small project which contain multiple verticles and some utilities classes.
I think it is the best test case to check this, and it help user to getting started with this wonderful framework..
If you need my help, let me know.

Regards

@purplefox
Copy link
Contributor

If your code is in the default package you need to cd into the directory where your source is before running it

@jvmvik
Copy link
Author

jvmvik commented Nov 28, 2012

I see it's a solution. But, it is not obvious for most of the user.
Sorry I do not have a suggestion.

@purplefox
Copy link
Contributor

We could probably enhance this.

@edubkendo
Copy link

A hint in the error message would be useful

purplefox pushed a commit that referenced this issue May 10, 2013
- Load java source files with getResource so java source verticles now work inside a module (fixes #444)
- Parse package definition from the java source and resolve java source root path based on that (fixes #433)
rmelick pushed a commit to rmelick/vert.x that referenced this issue Feb 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants