1

I have an eclipse codenameone project. I would like to execute this project on Eclipse using my own codenameone modified sources (codenameone sources project is in netbeans). How could I do that ?

enter image description here

As it is mentioned in this video, we should linked the project in the build path but it works only if we have a netbean project.

Better solution is to edit Codenameone source in Eclipse (but sources in github has structure of a Netbeans project).

Thanks!

1
  • Your question is not so clear.
    – Diamond
    Commented Feb 22, 2017 at 17:42

1 Answer 1

1

Right now debugging with the Codename One sources is only supported on NetBeans because that is the platforms we use for our coding. It's harder to work with other IDE's and might not be worth your effort.

Someone posted a while back in the discussion forum about running this in Eclipse but I couldn't find the reference.

Generally if you want to build the native sources and debug from there just work based on the logic we have and adapt it to Eclipse (or any other IDE). Running a Codename One project has 2 major dependencies:

  • Codename One project - that's a regular Java project you can work with
  • JavaSEPort another regular project, this is the implementation of the Codename One code and includes the simulator.

Make sure to add the source trees of both these projects to the compile but not packaging phases and set the Simulator class as your main class.

If you are successful in doing this it would be really nice if you write about it for the developer guide wiki next to the NetBeans build and explain how this is done for future developers.

9
  • Thanks for clarification. I've tried to adapt it to Eclipse but it's too complex because we have to adapt each project (create a java project, configure build path, configure run configuration to execute ant task ...). Furthermore, I was thinking we could also test modified sources of Port (Android, iOS etc) but I think we can't ??? Finally, I will do modification on netbeans and add codenameone jar compiled to my eclipse project. NB : I'm doing all of these to fix my ticket : github.com/codenameone/CodenameOne/issues/2040 Commented Feb 23, 2017 at 10:42
  • Using NetBeans is probably easier. I'll post this in the blog post today and see if the person who did this in Eclipse might notice and chime in...
    – Shai Almog
    Commented Feb 24, 2017 at 6:01
  • Ok nice. So if I would like to test my Android Port modification, how should I do ? Where do I have to include generated Android.jar ? I misunderstood how it works with Port when I compiled codenameone sources... Commented Feb 24, 2017 at 14:13
  • So the native code can't be simulated easily in this process. What we usually do to test is use "include sources" then do the modification in Android Studio and debug there and copy the changes back to the project source and make sure it compiles there.
    – Shai Almog
    Commented Feb 25, 2017 at 5:24
  • Ok, I didn't think about it :) I've now two problem in android studio project : 1) I'm not be able to debug codename1 package sources. I've put breakpoint but it doesn't stop there. 2) For my sources, I have only the compiled classes, so I can't put breakpoint here. Thanks for your help! Commented Feb 27, 2017 at 11:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.