3 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 3y 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 3y 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 3y agoNo technical reason, but you won't be able to run a compiled binary due to policy. You need to use an interpreter.
- cyberpunk 3y agoI wonder if qemu with cpu=host counts...
- greenavocado 3y agoMaybe run a VM inside Safari via QEMU and WASM that boots a Linux desktop environment
- lxgr 3y 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 3y 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 3y agoWhere did you get a non-GPL version of OpenJDK?
- jevinskie 3y agoAlternatively, where can I get the source for the app?
- jimbobthrowawy 3y 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 3y agoFair question if you've bought the app.
- echoangle 3y 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 3y 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 3y 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 3y 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 3y agoImpressive. Can you please work together with Oracle and make this available to everyone :) ? And did you also try to use GraalVM?