Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsLaunch error
https://www.eclipse.org/forums/index.php/mv/msg/1101814/1818721/#msg_1818721
I have created new Java project all fresh with basic println but there seems to be an issue of sorts with my Eclipse. When i try to launch the FirstSample.java i get error as in the picture stating "Selection does not contain a main type". Tried to compile and launch it in terminal - all went just fine, so it doesn't seem like i wrote anything wrong inside the file.
When i copied the FirstSample.java to Welcome folder (just to see whats up, as Welcome is working) - it launched no problem. So it seems i am missing some steps in creating a new project? I set only the name of the project and left everything at default settings.
Can anyone point me the right direction, what am i doing wrong here?]]>Martynas Vertelis2019-12-24T14:26:16-00:00Re: Launch error
https://www.eclipse.org/forums/index.php/mv/msg/1101814/1818723/#msg_1818723
Nitin Dahyabhai2019-12-24T14:48:06-00:00Re: Launch error
https://www.eclipse.org/forums/index.php/mv/msg/1101814/1818735/#msg_1818735
And as we are on the topic, if its not too much to ask, could you tell me what/why is happening here:
As all i did here was on myself, rather than book asking me to go and make new project, etc. - so i decided to go step by step and try to do Hello World through eclipse walkthrough, which actually seem to have put me on correct path - before i was just creating a project but not a class afterwards and it would seem this was one of the issues. HelloWorld.java i placed in src folder as you mentioned before but ran out into different situation which i got resolved but do not really understand what was happening there.
I was receiving error "Must declare a named package because this compilation unit is associated to the named module 'HelloWorld'" on the first line, which was resolved by deleting module-info.java (which was added there automatically by Eclipse).
The question i have is why or maybe what is wrong with module-info being in the same folder and what is it supposed to do at all given its added automatically? And if it is relevant for future how can i declare a named package?]]>Martynas Vertelis2019-12-25T12:56:05-00:00Re: Launch error
https://www.eclipse.org/forums/index.php/mv/msg/1101814/1818745/#msg_1818745
When you create your project, take special note of the JRE option in the wizard. Anything higher than 1.8 will cause the option to create a module-info.java file to both be possible and selected. I'd suggest you specifically target the 1.8 Execution Environment to avoid this.]]>Nitin Dahyabhai2019-12-26T17:14:25-00:00Re: Launch error
https://www.eclipse.org/forums/index.php/mv/msg/1101814/1818764/#msg_1818764
I have looked into this JRE version as you mentioned, and it does indeed not create module file. Did a lookup on this and from what i can find about it - older versions apparently are provided to help developers debug issues in older systems. Are there any pros or cons in regard to using older version, or in the end of the day it will not make much difference to me?]]>Martynas Vertelis2019-12-27T16:57:43-00:00