6 ms·
I got OpenJDK 17 to compile for iOS, but I had to disable JIT compilation as iOS doesn't allow running unsigned Code. Running the JVM itself is possible as lon
by coolius 2y ago
I got OpenJDK 17 to compile for iOS, but I had to disable JIT compilation as iOS doesn't allow running unsigned Code.
Running the JVM itself is possible as long as the binaries are signed, and located at the correct paths.
The paths issue really made me jump through hoops because Apple doesn't sign binaries unless they are bundled in Frameworks at the root of the bundle. That forced me to create symlinks to replicate the directory structure expected by the JVM while satisfying Apple's stupid policy.
Of course this whole thing only occured when I tried to submit to the App Store and the whole app was finished. I wasn't going to give up at that point.
- cyberpunk 2y agoIs there any technical reason why one couldn’t run e.g clang or go compilers in this way? I assume you’re running javac on-device?
- throwaway11460 2y agoNo technical reason, but you won't be able to run a compiled binary due to policy. You need to use an interpreter.
- cyberpunk 2y agoI wonder if qemu with cpu=host counts...
- greenavocado 2y agoMaybe run a VM inside Safari via QEMU and WASM that boots a Linux desktop environment
- lxgr 2y agoWASM is indeed one possible workaround. That's how a-Shell [1] manages to include a C compiler and run resulting programs at (I believe) better-than-interpreted speeds. [1] https://holzschu.github.io/a-Shell_iOS/ https://holzschu.github.io/a-Shell_iOS/
- indigoabstract 2y agoI don't use Java much these days, but for some reason I find this project inspiring. If only because of the level of commitment to get it working. I just wanted to say great job!
- jimbobthrowawy 2y agoWhere did you get a non-GPL version of OpenJDK?
- jevinskie 2y agoAlternatively, where can I get the source for the app?
- jimbobthrowawy 2y agoThe appstore ToS explicitly forbids submitting apps containing code under the GPL or similar licenses, which was one of the main reasons I asked.
- Benjamin_Dobell 2y agoFair question if you've bought the app.
- echoangle 2y agoYou can download it for free and you can then compile stuff with it, so you don't need to buy anything for this
- hnarn 2y agoOpenJDK isn’t mentioned once in the apps description, and it is GPL which means this entire application may have to be GPL (IANAL)
- kryptiskt 2y agoOpenJDK has the classpath exception in its version of the GPL, which allows non-GPL code to link to it without triggering GPL requirements.
- fweimer 2y agoThis is a common misconception. The Classpath exception only applies to the class library, not to Hotspot (the core of the JVM implementation). The class library is also more tightly integrated with Hotspot than it used to be. And of course the Classpath exception does not waive the notification and other requirements for the OpenJDK libraries that are distributed under the Classpath exception.
- karussell 2y agoImpressive. Can you please work together with Oracle and make this available to everyone :) ? And did you also try to use GraalVM?