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

Unable to initialize main class com.speedment.sources.Main #1

Open
solangepaz opened this issue Feb 21, 2019 · 3 comments
Open

Unable to initialize main class com.speedment.sources.Main #1

solangepaz opened this issue Feb 21, 2019 · 3 comments
Assignees
Labels

Comments

@solangepaz
Copy link

solangepaz commented Feb 21, 2019

Hi,
I tried execute this command
java -jar generate-speedment-sources.jar C:/Users/Emil/Documents/GitHub/speedment, but i obtained this error Error: Unable to initialize main class com.speedment.sources.Main Caused by: java.lang.NoClassDefFoundError: com/speedment/common/codegen/Generator.

@minborg minborg self-assigned this Feb 21, 2019
@minborg
Copy link
Contributor

minborg commented Feb 21, 2019

The jar file generate-speedment-sources.jar only contains the classes in the project and not its dependencies (such as codegen). If you open the project in an IDE (like IDEA or Netbeans) and click run, the IDE will take care of putting the dependencies on the classpath.

Also, you would replace the command line parameter with the path to the Speedment source code on your computer.

This project generates some classes in the Speedment project and these classes are included in Speedment. So, there is no need (except for curiosity) to run this project.

@solangepaz
Copy link
Author

Ok, thank you. I thought the project was different.
How can I then execute a query and see what classes the speedment is using during this execution? Because if I make a new maven project and add the dependency of the speedment I do not have access to the source code.

@minborg
Copy link
Contributor

minborg commented Feb 21, 2019

If you use an IDE (such as IDEA IntelliJ), you can start your project in debug mode and step through execution and see exactly what Speedment classes are being used. The IDE also allows you to download the source code from the Maven repository so you can see what is going on. Hope this helps you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants