ostroproject / ostro-os

Ostro OS
Other
93 stars 43 forks source link

Cant get java to run on Ostro #221

Closed Junaidsakib closed 6 years ago

Junaidsakib commented 6 years ago

I have built a Ostro image from the current repo and built this on a 14.04 Ubuntu machine. I have successfully installed this on a target machine with intel i7-64 bit architecture. As per my opinion Java should have come packaged with this however when I type java -version on the command line (Inside the target) I get Java command not found. How to overcome this and what do I miss. Please consider me a novice in this scenario (Flashing an OS for the first time) I am also not sure how to add the Help wanted tag with this question as this is not an issue exactly and am pretty sure I am missing something. Would just need a guide here to get me started.

Also here is my bblayers.conf

# The following layers are available in the combined repository.
# Their recipes are filtered via white-listing in ostro.conf,
# i.e. even if the layer gets added, only explicitly listed recipes
# are enabled. Enable layers here only if they have enabled recipes
# to avoid warnings about empty layers.

# OSTRO_LAYERS += "/home/ubuntu/Desktop/ostro-os/meta-openembedded/meta-efl"
# OSTRO_LAYERS += "/home/ubuntu/Desktop/ostro-os/meta-openembedded/meta-filesystems"
OSTRO_LAYERS += "/home/ubuntu/Desktop/ostro-os/meta-openembedded/meta-gnome"
# OSTRO_LAYERS += "/home/ubuntu/Desktop/ostro-os/meta-openembedded/meta-gpe"
# OSTRO_LAYERS += "/home/ubuntu/Desktop/ostro-os/meta-openembedded/meta-initramfs"
# OSTRO_LAYERS += "/home/ubuntu/Desktop/ostro-os/meta-openembedded/meta-multimedia"
OSTRO_LAYERS += "/home/ubuntu/Desktop/ostro-os/meta-openembedded/meta-networking"
OSTRO_LAYERS += "/home/ubuntu/Desktop/ostro-os/meta-openembedded/meta-oe"
# OSTRO_LAYERS += "/home/ubuntu/Desktop/ostro-os/meta-openembedded/meta-perl"
OSTRO_LAYERS += "/home/ubuntu/Desktop/ostro-os/meta-openembedded/meta-python"
# OSTRO_LAYERS += "/home/ubuntu/Desktop/ostro-os/meta-openembedded/meta-ruby"
# OSTRO_LAYERS += "/home/ubuntu/Desktop/ostro-os/meta-openembedded/meta-systemd"
# OSTRO_LAYERS += "/home/ubuntu/Desktop/ostro-os/meta-openembedded/meta-webserver"
# OSTRO_LAYERS += "/home/ubuntu/Desktop/ostro-os/meta-openembedded/meta-xfce"
# OSTRO_LAYERS += "/home/ubuntu/Desktop/ostro-os/meta-openembedded/toolchain-layer"
OSTRO_LAYERS += "/home/ubuntu/Desktop/ostro-os/meta-java"
OSTRO_LAYERS += "/home/ubuntu/Desktop/ostro-os/meta-soletta"

BBLAYERS ?= "${OSTRO_LAYERS}"

# toaster uses this hint to decide whether it let's the user
# remove a layer from BBLAYERS. All layers which provide something
# that is required to build ostro-image should be listed here.
# We do not really track that, so add all layers also here.
BBLAYERS_NON_REMOVABLE ?= "${OSTRO_LAYERS}"
gvancuts commented 6 years ago

You need to instruct the build system to add the JRE if it's not included by default. You can find instructions on how to do this here. You'll need to determine exactly what package(s) you want to add (e.g. openjre-8, openjk-7, ecc.). You may also need to add a few variables to define PREFERRED_PROVIDER (see the top-level README file in meta-java for more details.

The meta-java meta layer is already in place so you shouldn't need to do anything there.

Having said that, I should also warn you that the Ostro OS is no longer maintained and hasn't been updated for over a year. Depending on your exact needs, I would suggest you look for an alternative distribution that is still being maintained and more up to date.

Junaidsakib commented 6 years ago

I have tried everything you mentioned, but I cant get Java to run. I have rigirously followed the guides you mentioned.

gvancuts commented 6 years ago

Can you check if whatever JDK you added was successfully built and added to the image? From your build folder:

$ find tmp-glibc/deploy/ipk | grep -i jre
$ grep jre tmp-glibc/deploy/images/*manifest
Junaidsakib commented 6 years ago

The manifest does not contain anything as Java or Jre

Junaidsakib commented 6 years ago

Specifically I think i am not able to whitelist java while as the guide states something like: SUPPORTED_RECIPES_append = " ${TOPDIR}/conf/my-supported-recipes.txt" OSTRO_IMAGE_EXTRA_INSTALL += "tcpdump"

However what would be the Java equavalent?

gvancuts commented 6 years ago

Is there any particular version of Java you would like to use? If not, I would start with openjre-8.

Are you getting any error message? If this is a problem with the whitelisting, I'd expect you see something like this on the screen:

ERROR: The following unsupported recipes are required for the build:                         | ETA:  0:00:03
  openjre-8@meta-java (would be supported in workspacelayer)

Each unsupported recipe is identified by the recipe name and the collection
in which it occurs and has to be marked as supported (see below) using that
format. Typically each layer has exactly one collection.

To avoid this message, several options exist:
* Check the dependency chain(s) to see why a recipe gets pulled in and perhaps
  change recipe configurations or image content to avoid pulling in undesired
  components.
* If the recipe is supported in some other layer, disable the unsupported one
  with BBMASK.
* Add the unsupported recipes to one of the following files:
  /home/gvancuts/ostro-os/meta-ostro/conf/distro/include/devtool-supported-recipes.txt
  /home/gvancuts/ostro-os/meta-ostro/conf/distro/include/ostro-supported-recipes.txt
  Regular expressions are supported on both sides of the @ separator.
* Create a new file which lists the unsupported recipes and extend SUPPORTED_RECIPES:
    SUPPORTED_RECIPES_append = " <path>/recipes-supported-by-me.txt"
  See meta-ostro/conf/layer.conf and ostro.conf for an example how the path can be
  derived automatically. The expectation is that SUPPORTED_RECIPES gets set in
  distro configuration files, depending on the support provided by the distro
  creator.
* Disable the check with SUPPORTED_RECIPES_CHECK = "" in local.conf.
  'bitbake -g <build target>' produces .dot files showing these dependencies.
Junaidsakib commented 6 years ago

Thanks I got this working with the openjdk-8 I had to add this entry in the Local.conf and also in the manifest it was listed as openJdk and not as java or jvm so my search was failing. Now I am finding problems with getting the WIFI up. Thanks a lot for the help

gvancuts commented 6 years ago

Glad to hear you got past this problem. I'll let you close this ticket if you believe it's all clear now. Feel free to open new tickets for other problems you face although I'll reiterate my initial warning that the Ostro OS is no longer maintained and hasn't been updated for over a year. Depending on your exact needs, I would suggest you look for an alternative distribution that is still being maintained and more up to date.

Junaidsakib commented 6 years ago

Thanks @gvancuts I am doing this for an experimental project and plan to shift to Yocto for a Production image. I had got this piece of hardware with Ostro baked into it but it did not contain java which was required for my coding part. So I thought for a starter it would be a good start to go ahead with Ostro for now.