Compiling on Linux problem

Monkey Targets Forums/Android/Compiling on Linux problem

EdzUp(Posted 2013) [#1]
Hi I have downloaded the SDK and got the Android 13 download so I can use it with Monkey however when I compile into Android I get:
"/home/edzup/Desktop/MonkeyPro67c/bin/transcc_linux" -target=Android_Game -config=Debug "/home/edzup/Desktop/MonkeyPro67c/bananas/skn3/iconfun/iconfun.monkey"
Parsing...
Semanting...
Translating...
Building...
sh: 1: ant: not found
TRANS FAILED: Android build failed.
Done.


I can see the android option on compiling but it cant find ant I have looked into the android-sdk-linux directory and I dont see ant anywhere.

Anyone have any ideas?


therevills(Posted 2013) [#2]
Just download ant... Not sure if you still have to set the location in the monkey config file.


EdzUp(Posted 2013) [#3]
yeah realised this one Doh *face palm*

Now I get
"/home/edzup/Desktop/MonkeyPro67c/bin/transcc_linux" -target=Android_Game -config=Debug -run "/home/edzup/Desktop/MonkeyPro67c/bananas/skn3/iconfun/iconfun.monkey"
Parsing...
Semanting...
Translating...
Building...
Unable to locate tools.jar. Expected to find it in /usr/lib/jvm/java-7-openjdk-i386/lib/tools.jar
Buildfile: /home/edzup/Desktop/MonkeyPro67c/bananas/skn3/iconfun/iconfun.build/android/build.xml

-check-env:
 [checkenv] Android SDK Tools Revision 21.0.1
 [checkenv] Installed at /home/edzup/android-sdk-linux

-setup:
     [echo] Project Name: MonkeyGame
  [gettype] Project Type: Application

-pre-clean:

clean:
   [delete] Deleting directory /home/edzup/Desktop/MonkeyPro67c/bananas/skn3/iconfun/iconfun.build/android/bin
   [delete] Deleting directory /home/edzup/Desktop/MonkeyPro67c/bananas/skn3/iconfun/iconfun.build/android/gen
[getlibpath] Library dependencies:
[getlibpath] No Libraries
   [subant] No sub-builds to iterate on

BUILD SUCCESSFUL
Total time: 2 seconds
Unable to locate tools.jar. Expected to find it in /usr/lib/jvm/java-7-openjdk-i386/lib/tools.jar
Buildfile: /home/edzup/Desktop/MonkeyPro67c/bananas/skn3/iconfun/iconfun.build/android/build.xml

-set-mode-check:

-set-debug-files:

-check-env:
 [checkenv] Android SDK Tools Revision 21.0.1
 [checkenv] Installed at /home/edzup/android-sdk-linux

-setup:
     [echo] Project Name: MonkeyGame
  [gettype] Project Type: Application

-set-debug-mode:

-debug-obfuscation-check:

-build-setup:
     [echo] Resolving Build Target for MonkeyGame...
[gettarget] Project Target:   Android 3.2
[gettarget] API level:        13
     [echo] ----------
     [echo] Creating output directories if needed...
    [mkdir] Created dir: /home/edzup/Desktop/MonkeyPro67c/bananas/skn3/iconfun/iconfun.build/android/bin
    [mkdir] Created dir: /home/edzup/Desktop/MonkeyPro67c/bananas/skn3/iconfun/iconfun.build/android/bin/res
    [mkdir] Created dir: /home/edzup/Desktop/MonkeyPro67c/bananas/skn3/iconfun/iconfun.build/android/gen
    [mkdir] Created dir: /home/edzup/Desktop/MonkeyPro67c/bananas/skn3/iconfun/iconfun.build/android/bin/classes
    [mkdir] Created dir: /home/edzup/Desktop/MonkeyPro67c/bananas/skn3/iconfun/iconfun.build/android/bin/dexedLibs
     [echo] ----------
     [echo] Resolving Dependencies for MonkeyGame...
[dependency] Library dependencies:
[dependency] No Libraries
[dependency] 
[dependency] ------------------
[dependency] API<=15: Adding annotations.jar to the classpath.
     [echo] ----------
     [echo] Building Libraries with 'debug'...
   [subant] No sub-builds to iterate on

-pre-build:

-code-gen:
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
     [echo] Handling aidl files...
     [aidl] No AIDL files to compile.
     [echo] ----------
     [echo] Handling RenderScript files...
[renderscript] No RenderScript files to compile.
     [echo] ----------
     [echo] Handling Resources...
     [aapt] Generating resource IDs...
     [echo] ----------
     [echo] Handling BuildConfig class...
[buildconfig] Generating BuildConfig class.

-pre-compile:

-compile:

BUILD FAILED
/home/edzup/android-sdk-linux/tools/ant/build.xml:710: The following error occurred while executing this line:
/home/edzup/android-sdk-linux/tools/ant/build.xml:723: Unable to find a javac compiler;
TRANS FAILED: Android build failed.
com.sun.tools.javac.Main is not on the classpath.
Done.

I downloaded the JDK but it compiles and the command is in terminal but apparently Monkey fails to locate it.


Plain(Posted 2013) [#4]
Probably a dumb one. But have you already restarted?

It's necessary for the JDK to be detected.

And did you install the Oracle JDK or OpenJDK?


EdzUp(Posted 2013) [#5]
I tried both but no luck which is a pain :/

When i get to the bottom of this a tutorial is in order me thinks


slenkar(Posted 2013) [#6]
I have gotten android compilation working on linux,

you have to specify the location of the JDK in the config file too y'know

and you absolutely have to use the oracle JDK cos its the only one that has tools.jar


EdzUp(Posted 2013) [#7]
Where do you have to specify it which files? I only ask as quite a few people say its a Linux file others say its something in java. Could ya be more specific as its a quagmire of information ATM


Plain(Posted 2013) [#8]
Alright. Make sure you installed the Oracle JDK (that's why I asked.. OpenJDK is nice, but it's missing stuff)

Inside the bin folder of your Monkey-folder, there should be a file called config.linux.txt.

This is the config file slenkar was talking about. In here, make SURE you set the JDK path etc. You should be ready to go after this.


Plain(Posted 2013) [#9]
Hmm. Sidenote: there isn't an entry for JDK-path in the config.linux.txt.

Hmm. Let me check this.


EdzUp(Posted 2013) [#10]
Yeah thats why i thought it was strange, maybe it should be added before the v67 goes final :)


slenkar(Posted 2013) [#11]
copy it from the windows.config file in /bin