1

Followed the instructions up to running the app in the simulator. Fine. However, I did not manage to prevent Eclipse from showing this error. Any help would be nice

Also, I must mention that the *.launch files are not in tools/eclipse but in the project root directory. My 2 pence.

StartPageController cannot be resolved

ebardet
  • 230
  • 1
  • 9
  • What is the qualified name of `StartPageController`? Do you have an import statement for it? Please show your code as text. If you have an import statement (for which also an error is shown), and if it's a Maven project, please also show your `pom.xml`. Please also tell whether you have a `module-info.java` file. – howlger Aug 04 '23 at 11:59
  • This class belongs to the same package. It gets generated from the StartPage view at compile-time by the CodeRAD annotation processor. – ebardet Aug 04 '23 at 12:54
  • I'm not an expert on Eclipse but according to [this](https://stackoverflow.com/questions/11030422/successful-build-in-maven-still-showing-errors-in-eclipse) "There's an entry in the Maven context menu to update the Configuration." That might help. If it works it seems that Eclipse is just out of sync with Maven. This happens in IntelliJ too and requires a simple maven refresh. – Shai Almog Aug 05 '23 at 03:41
  • Then your project is not correctly configured. If you use a build system like Maven, Gradle, etc., please show your build file. Otherwise, _Project > Properties: Java Compiler > Annotation Processing_ has to be configured manually. – howlger Aug 05 '23 at 10:06
  • @ShaiAlmog In Eclipse this should happen automatically (on save), assuming _Project > Properties: Java Compiler > Annotation Processing_ is configured correctly. – howlger Aug 05 '23 at 10:08
  • @howlger You can download such a project from https://start.codenameone.com/ if there are specific changes to make that will help it become more eclipse friendly we'll be happy to make them. – Shai Almog Aug 06 '23 at 02:33
  • @ShaiAlmog When I select Eclipse as IDE on this page, the ZIP file offered for download, contains, contrary to what I selected, `.idea` and `.vscode` folders, but no `.settings` folders. – howlger Aug 06 '23 at 07:59
  • That might be a bug in the generation code. It generates launchers but not `.settings` what should a `.settings` file contain for this type of project? – Shai Almog Aug 07 '23 at 02:48
  • BTW the code for the maven archetype that generates all of this is [here](https://github.com/shannah/cn1-maven-archetypes/tree/master/cn1app-archetype/src/main/resources/archetype-resources/tools/eclipse). – Shai Almog Aug 07 '23 at 02:52
  • @ShaiAlmog In Eclipse, a Java project contains a `.project` and a `.classpath` file and a `.settings` folder with `*.prefs` files. A few things can be derived from the `pom.xml`, but most things are not covered by Maven. See _Project > Properties_, especially the sections where the checkbox _Enable project specific settings_ is checked. [Here](https://github.com/shannah/cn1-maven-archetypes/tree/master/cn1app-archetype/src/main/resources/archetype-resources/tools/eclipse) are only launch configurations. – howlger Aug 07 '23 at 07:35
  • @ShaiAlmog Following your discussion with howlger, I managed to get rid of my primary problem by : 1. Adding org.eclipse.m2e.apt.mode=jdt_apt to the ./common/.settings/org.eclipse.m2e.apt.prefs 2. Adding target/generated-sources/rad-views to the .classpath – ebardet Aug 08 '23 at 09:46
  • @ebardet I suggest filing an issue on out git with examples of the files you had to add so we can fix the code generation logic for eclipse. – Shai Almog Aug 09 '23 at 02:39
  • 1
    @ShaiAlmog, done :) https://github.com/codenameone/CodenameOne/issues/3724 – ebardet Aug 09 '23 at 10:06
  • @ebardet Can you attach the resulting configuration files to the issue? – Shai Almog Aug 10 '23 at 02:44
  • @ShaiAlmog, I added what I think is relevant. If you need more, just ask – ebardet Aug 10 '23 at 08:53
  • Thanks, we'll try to use that to improve the generated project. – Shai Almog Aug 11 '23 at 02:41

0 Answers0