TeamSpeak-3-Java-API icon indicating copy to clipboard operation
TeamSpeak-3-Java-API copied to clipboard

Could not find main method from given launch configuration

Open iLeGiTiMx opened this issue 5 years ago • 2 comments

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

iLeGiTiMx avatar Apr 12 '19 02:04 iLeGiTiMx

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.

somewhatadev avatar Apr 15 '19 06:04 somewhatadev

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

iLeGiTiMx avatar Apr 16 '19 14:04 iLeGiTiMx