Hi
I recently started using Processing and wanted to use it from my familiar IDE (IntelliJ) and with my preferred language (Kotlin).
I stumbled upon some interesting reads ([1], [2], [3]) and created a project template upon that basis.
You can find it here: Moritz Lindner / Processing Kotlin Gradle Template · GitLab
With this, you no longer need to have processing installed and manually add it as a project dependency since its present as a Gradle dependency. Therefore, it should be much easier to share your project via git.
A version using the Processing 4 library will come soon.
Important Infos:
- Please make sure to use a Java 8 JDK
Please share your thoughts and give me feedback
Known Issues:
- The
P2D
andP3D
renderers don’t work on apple m1 chips:
This is because of an error in the macOS arm build of the used java OpenGL binding library (jogl) which is used by Processing. (I think a fix is available [4] but the best solution would be a fix in the processing library)
If you are trying to run the application on apple silicon with one of those renderers the following error will occur:
java.lang.UnsatisfiedLinkError: /private/var/folders/kv/drx4695s5p91vm8chh27scv00000gn/T/jogamp_0000/file_cache/jln3913932672952410849/jln113904259977141220/natives/macosx-universal/libgluegen-rt.jnilib: dlopen(/private/var/folders/kv/drx4695s5p91vm8chh27scv00000gn/T/jogamp_0000/file_cache/jln3913932672952410849/jln113904259977141220/natives/macosx-universal/libgluegen-rt.jnilib, 0x0001): tried: '/private/var/folders/kv/drx4695s5p91vm8chh27scv00000gn/T/jogamp_0000/file_cache/jln3913932672952410849/jln113904259977141220/natives/macosx-universal/libgluegen-rt.jnilib' (fat file, but missing compatible architecture (have 'i386,x86_64', need 'arm64e')), '/usr/lib/libgluegen-rt.jnilib' (no such file)
I tried solving the issue by excluding the jogl dependency with the error and using the in [4] discussed dependency. But this only resulted in this runtime error:
`java.lang.UnsatisfiedLinkError: Can't load library: /Users/.../ProcessingProject/natives/macosx-universal//gluegen-rt`
If you have any ideas let me know.
Resources:
(Links coming soon because new users can only have 2 links in a post. So just google it if you are interested :))
[1] Writing Processing in Kotlin
[2] How To Write Processing Code In Kotlin
[3] Using P2D and P3D Renderers In Kotlin Processing Sketches
[4] JOGL for Mac ARM Silicon (make sure to read page 2. The forum is pretty ugly)