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

Could not find main method from given launch configuration #325

Open
iLeGiTiMx opened this issue Apr 12, 2019 · 2 comments
Open

Could not find main method from given launch configuration #325

iLeGiTiMx opened this issue Apr 12, 2019 · 2 comments

Comments

@iLeGiTiMx
Copy link

Hello,

I have a problem with compiling the Jar file.
I did it like others in their tutorial videos (just the compiler step), but I am getting the error in the title.
Here is a short video of my problem:

https://youtu.be/DxtmizoAeuQ

I don´t know what to do. If I create a new project, everything is fine. If I add the library and my sourcecode, the compiler doesn´t work anymore.

Where is the mistake? The bot is working fine in the eclipse debugger, but not as standalone.
Thank you so far..

Best regards,
ilegitimx

@somewhatadev
Copy link
Contributor

Hi @iLeGiTiMx, generally you could try to convert your project to the Java naming conventions:

  • Package names are always written in lower-case letters (e.g. com.test.mypackage)
  • Class names begin with upper-case letters and are written in UpperCamelCase (e.g. MyClass)
  • Method names begin with lower-case letters and are written in lowerCamelCase (e.g. myTestMethod)

However, your IDE cannot find your main class to execute. You could try the following approaches:

  1. Click on the project > Run As > Java Application (only for Eclipse, as in your case)
  2. Create a manifest.mf yourself with the entry point (Main-Class). See here for further reference.
  3. Setting the entry point with the JAR tool (e.g. jar cfe MyJar.jar com.test.mypackage.MyClass com.test.mypackage/MyClass.class - note that this command is based on my above examples, you need to adjust the names yourself)

If the above approaches still won't work, please get in touch with us again.

@iLeGiTiMx
Copy link
Author

Hello,
I have uninstalled Eclipse and used IntelliJ. So much better, everything works now :)
But thank you.

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

No branches or pull requests

2 participants