1

I have a set of Java background programs (daemons) I'd like to port to Android. The programs are OpenJDK 1.6 compatible, they currently run on Linux.

I have a couple of questions:

  1. Is Android compatible with OpenJDK 1.6?
  2. How would I compile the programs for Android?

Thank you, Caesar.

CaesarS
  • 113
  • 2
  • Android has a different approach to applications than ordinary java vms. You cannot just "compile for android". Have a look at the developer website of android. – Fildor Jul 11 '15 at 21:02
  • possible duplicate of [How does Android's Java version relate to a Java SE version?](http://stackoverflow.com/questions/7535385/how-does-androids-java-version-relate-to-a-java-se-version) – Jared Burrows Jul 11 '15 at 21:17

1 Answers1

0

Is Android compatible with OpenJDK 1.6?

In terms of bytecodes, yes. However, existing Java code may well use classes that are not in the Android SDK but happen to be in Java SE, Java EE, etc.

How would I compile the programs for Android?

You don't. You write an Android app that happens to reuse some of your existing code. For example, there is no user interface in a Java SE or Java EE app that will work well out of the box on Android.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491