Skip to content

Commit c45c15a

Browse files
committed
Clarify IDE workflows and JDK requirements in developer guide
1 parent e2e8e26 commit c45c15a

File tree

1 file changed

+35
-12
lines changed

1 file changed

+35
-12
lines changed

docs/developer-guide/Index.asciidoc

Lines changed: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
== Introduction
22

3-
Codename One is a Write Once Run Anywhere mobile development platform for Java/Kotlin developers. It integrates with IntelliJ/IDEA, Eclipse or NetBeans to provide seamless native mobile development.
3+
Codename One is a Write Once Run Anywhere mobile development platform for Java/Kotlin developers. It fits naturally into modern Maven-capable IDEs such as IntelliJ IDEA, NetBeans, VS Code and Eclipse, and it can also be driven entirely from the command line.
44

55
Codename One's mission statement is:
66

@@ -219,17 +219,43 @@ This means that in runtime a user might revoke a permission. A good example in t
219219

220220
=== Installing Codename One
221221

222-
IMPORTANT: The minimum JDK for Codename One is JDK 8 notice that newer JDKs might not be supported immediately. Currently JDK 11 is known to work and JDK 17 support is in beta stages.
222+
IMPORTANT: Codename One requires either JDK 11 or JDK 8. Other JDK versions are not supported at this time.
223223

224-
IMPORTANT: The IDE plugins for Codename One are no longer supported. They are required for legacy Ant applications which is why they are still available for download!
224+
Codename One projects are built with Maven. Typical Maven targets such as `package`, `clean` and `install` work out of the box, but the Codename One integrations that ship with each IDE provide dedicated Run and Build actions for a smoother workflow.
225225

226-
Starting with version 7.0 a Codename One project is a standard Maven project. Typical Maven targets such as package, clean and install should work as expected. Dependencies can be added just like any other project.
226+
To create a new Codename One project visit https://start.codenameone.com/ and generate a starter project, or run the Codename One Application Project Archetype (`cn1app-archetype`) directly on the command line:
227227

228-
NOTE: Arbitrary Maven dependencies probably won't work for Codename One. Many dependencies assume a full JDK which Codename One can't provide and they often assume functionality that might not be available e.g. reflection, Spring, etc.
228+
[source,bash]
229+
----
230+
mvn archetype:generate \
231+
-DarchetypeGroupId=com.codenameone \
232+
-DarchetypeArtifactId=cn1app-archetype \
233+
-DarchetypeVersion=LATEST \
234+
-DgroupId=YOUR_GROUP_ID \
235+
-DartifactId=YOUR_ARTIFACT_ID \
236+
-Dversion=1.0-SNAPSHOT \
237+
-DmainName=YOUR_MAIN_NAME \
238+
-DinteractiveMode=false
239+
----
229240

230-
To create a new Codename One project visit https://start.codenameone.com/ and generate a starter project. For further details about configuring maven check out https://shannah.github.io/codenameone-maven-manual/
241+
This command generates a project in the current directory. The folder name matches the `artifactId` value. For example, specifying `-DartifactId=myapp` produces a project inside a new `myapp` directory.
231242

232-
The Codename One maven plugin supports for IntelliJ/IDEA, VSCode, Eclipse, NetBeans and the Command Line. Other targets might work.
243+
Import the generated Maven project into your preferred IDE and use the Codename One Run in Simulator task from the IDE toolbar or Run/Debug buttons:
244+
245+
* *IntelliJ IDEA* – use *File > Open* on the project directory, then choose the Codename One Run in Simulator action from the toolbar or standard Run/Debug controls.
246+
* *NetBeans* – use *File > Open Project*, select the generated Maven project, and rely on the Codename One toolbar actions to run and debug the simulator.
247+
* *VS Code* – install the Java and Codename One extensions, open the folder, and trigger the Run in Simulator task from the command palette or the Run/Debug buttons.
248+
* *Eclipse* – use *File > Import > Existing Maven Projects*, then use the Codename One launch shortcuts provided by the plugin for simulator and build tasks.
249+
* *Command line* – invoke Maven goals directly whenever you need to integrate with CI/CD pipelines or scripting.
250+
251+
For deeper coverage of the Maven goals and project structure, see the https://shannah.github.io/codenameone-maven-manual/[Codename One Maven Manual].
252+
253+
NOTE: Arbitrary Maven dependencies probably won't work for Codename One. Many dependencies assume a full JDK which Codename One can't provide and they often assume functionality that might not be available e.g. reflection, Spring, etc.
254+
255+
.Legacy onboarding resources
256+
****
257+
The retired Ant-based IDE plugins for NetBeans, Eclipse and IntelliJ IDEA – together with the simulator screenshots from those workflows – are still available in the legacy documentation for teams maintaining older projects. New projects should follow the Maven-based instructions above.
258+
****
233259

234260
==== Important Notes for New Projects
235261

@@ -258,16 +284,13 @@ To come up with the right package name use a reverse domain notation. So if my w
258284

259285
==== Runtime
260286

261-
Once maven is set up we can run the `HelloWorld` application by pressing the `Play` or `Run` button in the IDE. When we do that the Codename One simulator launches. You can use the menu of the simulator to control and inspect details related to the device. You can rotate it, determine it's location in the world, monitor networking calls etc.
287+
Once Maven is set up we can run the `HelloWorld` application by selecting the Codename One Run in Simulator task from the IDE run menu. The Codename One simulator launches and you can use its menus to control and inspect details related to the device. You can rotate it, determine its location in the world, monitor networking calls etc.
262288

263289
With the `Skins` menu you can download device skins to see how your app will look on different devices.
264290

265291
TIP: Some skins are bigger than the screen size, uncheck the `Scrollable` flag in the `Simulator` menu to handle them more effectively
266292

267-
Debug works just like `Run` by pressing the IDE's debug button. It allows us to launch the simulator in debug mode where we can set breakpoints, inspect variables etc.
268-
269-
.HelloWorld Running on the Simulator with an iPhone X Skin
270-
image::img/developer-guide/codenameone-hello-world-simulator.png[HelloWorld Running on the Simulator with an iPhone X Skin,scaledwidth=50%]
293+
Use your IDE's Debug button with the Run in Simulator task to launch the simulator under the debugger.
271294

272295
.Simulator vs. Emulator
273296
****

0 commit comments

Comments
 (0)