How to add Java files to a repo like BeSly?

Several of my Apps/Games are written in Java. Is there a way to bundle them in a .hpkg file for uploading to a repo like BeSly? Right now they are in .jar format…

Hey MarisaG, yes create a HPKG file of you programs/games and send them to us.
If you have files used from many programes at same time you can make a hpkg as dependecies with this files.

You can use my HPKGCreator (Vendor: “BeSly Software Solutions”). If you need help to package them you can send me or @lorglas the files and we create the hpkg for you.

1 Like

But what do I put as the command to get the .jar files to run? Dependancies?

you can add cmd:java as a dependency if you want

1 Like

How do I specify what to do with the bundled .jar file? Also how do I add the icon?

You can make a hkpg with the installation position /system/data/java/filename.jar for example and use this source position in your programs.

Icon: How to add a icon to a binary

There is no launcher as such, you will need to add a shell script for example. Trouble is that java isn’t in the PATH either :g

You could try something like

#!sh
if test -f /system/lib/openjdk8/bin/java;
then
/system/lib/openjdk8/bin/java -jar pathtojar
fi

but this is also badly portable : /

Kind of would need a jar launcher installed with java per default and asdociated with jar files but we don’t have that at the moment

Is there no link of the binary to /boot/system/bin?

Normally you start .jar files like this:

java -jar MyApp.jar

So the sartscript can be like this:

#!sh
java -jar /boot/system/Apps/NameOfApp/ProgramName.jar
1 Like

no, i said so above already

There are a packages that do just that. If you want java 11 to be in the path, install openjdk11_default. If you want Java 8, install openjdk8_default. And so on.

If you don’t have any default one installed you have to specify the full path.

If your package depends on cmd:java, one of these packages should be installed as a dependency, and you can specify a version requirement if you want a specific one. However, it’s probably a better idea to not depend on a specific “default” package being installed, and use the full path. This way, your package can be used even by people who want another Java version to be the default one.

3 Likes

Why openjdk11_default is only 1.7 KB size?

Because it does only what said Pulkomandy, it sets this version of java to be the default.
This way, you can have also openjdk8 to run some progs that won’t support the more recent version that you will use by default. Of course, for using openjdk8 you have to use full path.

3 Likes

Can I email you what I have for you to look at and for me to use as a example for my other projects?

1 Like