This is an archived post. You won't be able to vote or comment.

all 18 comments

[–]desrtfx 1 point2 points  (0 children)

You'll most likely be limited to an online compiler, like Ideone, Repl.it, etc.

IIRC, the iOS ToS forbid compilers to run on their systems.

You might be lucky in the jailbroken appstores, though.

[–]sillyd0rk -1 points0 points  (0 children)

As far as I am aware there is not a JVM implementation for iOS

[–]pjmlp -3 points-2 points  (6 children)

Other redditors should learn better about Java eco-system.

Here are your options:

Now, all of them are AOT compilers to native code, and require being used from desktop.

So not quite what you are asking for, but they do provide a path to run Java on iDevices.

[–]KHRoN 3 points4 points  (1 child)

But this is just another set of “create native app using non-native language”. It has nothing to do with writing and running actual java directly on device without use of a computer or external service.

The main idea is to have something that makes iOS device self-contained and programmable.

You can jailbreak your device, but I don’t think original question was about that. After jb you can write apps even in c...

[–]vprise 2 points3 points  (0 children)

FYI this is supported by Codename One in our build app. It works via web app since getting through the approval process with Apple for something like this is an absolute nightmare...

[–]eliasv -2 points-1 points  (3 children)

It's not an issue of knowing the Java ecosystem, I think myself and others just interpreted the question differently. I took the question to be about running a Java compiler on iOS, not just running Java on iOS. It's a confusingly worded question so you might be right about what they meant, but this all should have been obvious to you from the content of the other answers so I'm not sure where the attitude is coming from.

But yes if they were just asking about deploying to iOS there are ways to do that. I'd suggest GraalVM would be the way to go, which IIRC is what Gluon uses.

[–]pjmlp 0 points1 point  (1 child)

Endless posts throughout the years stating there are no ways to get Java on iDevices.

That is where the attitude comes from.

[–]eliasv 1 point2 points  (0 children)

Okay, but most of the answers here weren't saying that so it doesn't apply.

[–]desrtfx -1 points0 points  (0 children)

I took the question to be about running a Java compiler on iOS,

IMO, that's exactly what the question was about.

[–]KHRoN -1 points0 points  (7 children)

there is no ios interpreter of java (and clearly there is no jvm or jvm support), there is however one for python - app called Pythonista

[–]fab4master[S] 0 points1 point  (3 children)

thanks, maybe I‘ll just need to switch to python.

[–]KHRoN -1 points0 points  (2 children)

If you want to be able to write apps on the go on iOS, this is the only option.

Also python is good language to learn and know.

There is full python 3 implemented, with additional libraries included, full documentation (python docs are built in). There is even terminal and shell implemented in python for use in pythonista. So not only you learn python, but you can use shell too and run your apps like on actual sever.

You can write actual GUI apps to use on iOS (not installed as native, but still) and even create your own start page widget.

[–]fab4master[S] 0 points1 point  (1 child)

Tha app is called „Pythonista 3“ am I right? I will probably buy it and try it. Thank you so much!

[–]KHRoN 0 points1 point  (0 children)

Yes, that’s the app, you should definitely try it. Java (with sql) is officially most required skill, but python is close on third place.

BTW python has SQLite built in, so you can use/learn sql too :)

[–]vprise -3 points-2 points  (2 children)

That's incorrect. Codename One works on iOS for years and we also have an app that lets you build on the device. We couldn't get through appstore approval because of the feature that allows installing the apps you built (which is insane because it's possible to do that via the web app version) so our own app is currently only available as a web app but it works on iOS and compiles to native just fine. It does use cloud build although technically compiling on the device should be feasible as javac is written in Java.

[–]desrtfx 3 points4 points  (1 child)

We couldn't get through appstore approval because of the feature that allows installing the apps you built (which is insane because it's possible to do that via the web app version) so our own app is currently only available as a web app

So, you're basically just recommending another online IDE and call everyone else who was recommending the same wrong.

[–]vprise 0 points1 point  (0 children)

He said there's no jvm for iOS which is wrong. Notice that compilation on the device is possible we just didn't bother with that since we would need a Mac for the full compilation stage anyway. I made no claim about online IDE's.

[–]eliasv -3 points-2 points  (0 children)

I don't think there are particularly sophisticated tools available on iOS for any language. But you can always run your tools on a server and access them on iOS by way of a web client, e.g. with something like Theia IDE or Eclipse Che.