- This topic has 3 replies, 2 voices, and was last updated 10 years ago by support-swapna.
-
AuthorPosts
-
jessrplMemberHello,
I recently moved from MyEclipse 8.6 to MyEclipse 2014. In MyEclipse 8.6, while working in a Java command line project, when I clicked on the green play button to run my app, or when I pressed Ctrl+F11, the project associated with the currently visible class in the editor would execute. If that project did not already have a run configuration there would be a prompt for the location of the Main class and after it was located the project would run. If a run configuration already existed for that project it was used to run the project. This behavior was true for all classes within a project, including the Main class that included “public static void main(String[] args)” and other custom classes that did not include a main method.
In MyEclipse 2014 I am finding this behavior is no longer the same. If the Main class that includes “public static void main(String[] args)” is visible in the editor and I click on Run, or press Ctrl+F11, then my app runs, and uses an existing run configuration without issue. If I am in a custom class within my project that does not include a Main method then “Run” does nothing. No errors, No popups. Nothing.
The menu option Run->Run As shows “Java Application” as an option while the Main class is visible. While in another class in the same project there is no “Java Application” option available in the menu Run->Run As.
To recreate:
– Run MyEclipse 2014 and make it point to a new workspace
– File->New->Java Project. Name it something, for example, Just_a_Test. Use the default options and click finish.
– Right click on the project’s src folder and make a new class named Main. Check the box for “public static void main(String[] args)”
– Right click on the project’s src folder and make a new class named Custom.
– With the Custom class visible in the editor press Ctrl-F11. Nothing will happen. Click the green play button. Nothing will happen.
– With the Main class visible in the editor press Ctrl-F11 or click the green play button. The Run As dialog box appears and choosing Java Application runs the project.In Window->Preference->Run/Debug->Launching the Launch Operation is set to “Launch the selected resource or active editor. If not launchable: Launch the associated project”.
How do I restore the previous functionality of running my project while a class without a main method is visible?
support-swapnaModeratorjessrpl,
Thank you for raising it. I could replicate the issue at my end. I raised a PR for the dev team to look into it.
I could select the ‘Launch Type’ by clicking on F11 on the Custom class instead of Ctrl+F11 for the case you mentioned. Can you please check if it works for you?
jessrplMemberswapna,
When I press F11 it shows the Debug As menu. This works in the Main class or the Custom class. If there is an existing run configuration pressing F11 debugs the app. This behavior is exactly what I would have expected per how MyEclipse 8.6 operated.
When do you expect the dev team will have a solution for running a project in the same way?
support-swapnaModeratorJessrpl,
The fix is expected to be out with MyEclipse 2015 GA release which is targeted for end of June 2014.
Let us know if you see any issues.
-
AuthorPosts