Getting java working on UBTouch

  • @ComLarsic Some time ago I tried to run librespot-java using various versions of openjdk. They all caused kernel crashes (related to pulse audio) and made my phone reboot (opo). Sorry, no java for me.

  • @wdehoog i am not getting any kernel crashes, the app just closes itself.
    i have ran openjdk directly using the terminal before and everything seemed to be running fine. maybe its a device specific problem?

  • Java does not have Mir or Wayland backends, and therefore works on your PC because you are using X11, while the phone is not. I'm pretty sure you would see an error about DISPLAY if you check the log file.

    You will need to add X-Ubuntu-XMir-Enable=true to your .desktop file.

    Also, you really should not include the binaries in your git repo, but instead pull them in during the clickable build process, so you can avoid having architecture-dependent things in the repo. You should avoid duplicating data/source files otherwise, too.

  • @dobey Ah ok! thanks for the tips!

  • @dobey i tried adding thr line to the .desktop file but it still closes on launch.

    you mentioned something about a log file, i am sorry if this is a bit of a newbie question but where could i find the log file?

  • @ComLarsic

    You can use this app as a convenience :
    And you can have a look in .cache/upstart/

  • After adding the line to the desktop file i seem to still not be able to run the app.

    i checked the .desktop file in /home/phablet/.local/share/applications

    and tried running the line behind Exec=
    Manually in the terminal like so:
    aa-exec-click -p javatest.comlarsic_JavaTest_1.5.0 -- JavaBin/bin/java -jar main.jar
    and i get the error aa-exec: ERROR: profile 'javatest.comlarsic_JavaTest_1.5.0' does not exist

    Here is the .desktop file that shows in the applications folder:

    [Desktop Entry]
    Exec=aa-exec-click -p javatest.comlarsic_JavaTest_1.5.0 -- JavaBin/bin/java -jar main.jar

    what seems to be going wrong here?

  • @ComLarsic Try uninstalling the app, and then installing it again. Or change the version number and building a new click, and installing that.

    You did edit the original .desktop file and build a new click, rather than editing the .desktop in ~/.local/share/applications/ right?

  • @dobey no, i did not edit the .desktop in the applicion folder manually. i have tried reinstalling it and i still get the same error. i will try to rebuild it and completly remove the app using UTTweak tool

  • I just had a bit of a play with this and was able to get it working with just the following changes to the original repository:

    1. Set X-Ubuntu-XMir-Enable=true in the .desktop file
    2. Remove the policy groups from the AppArmor profile and set "template": "unconfined", instead

    It seems x-mir-helper isn't able to launch confined, perhaps there should be a discussion about adding an AppArmor policy for these use cases?

    Photo of a Java application running on BQ Aquaris 4.5

  • @Elleo said in Getting java working on UBTouch:

    It seems x-mir-helper isn't able to launch confined, perhaps there should be a discussion about adding an AppArmor policy for these use cases?

    If that's true, probably a good idea to open an issue about it at

  • @dobey Okay, will do!

Log in to reply