It’s finally the time to work with/port some Java stuff here. But I feel really stupid, but I stucked myself pratically at the beginning of the journey:
I installed openjdk13_jre from the depot. Checked the content: everything is there (bins, mans, …)
Terminal > java --version
command not found. Not in the path perhaps?
So, I made a better check in the depot and found two other packages which were not installed when I installed the jre
the parent package openjdk (wtf?)
a _default sibling pakage
I installed both. The bins are in the right path now, but the mans are still missing
Perhaps I did something wrong here (but what exactly?), but in any case I think the process should be documented somewhere for the newcomers like me…
In facts, in the main package all the files are inside a lib/openjdk13 tree (including bin and man). I thought it was weird, ofc, but I guess there is a reason for that.
the _default sibling I think just symlinks the binaries on the right path
Openjdk jre and jdk packages are meant to be installable side by side, there are scripts to source, to get the jre or jdk environment for a specific version. For the man pages i don’t know.
OmegaT is a java application (Translation Software Available (OmegaT) ), and can be launched just like this: java -jar omegat.jar
Launching it like that leaves the Java icon on the deskbar.
Without touching the Java code, the process seems to be the same as with Python. I’m working on it though I have it stalled until I finish with Manuskript.
With this you still get the Java icon on the deskbar, but you can launch the java application with double click, -with the right paths for Java and the .jar file, of course- from the menu (if properly packaged)…
For a better integration, I’ve found that using <jni.h> seems the way to go, same as with Python using <python.h>. Nonetheless, I haven’t gone much farther, didn’t experimented that much and had lots of problems finding the header file (I’m having some issues finding java lately-same as what you pointed out that command not found) as first I should finish the Python one before moving to bringing OmegaT as an integrated application.
This, of course, will depend on what you want to achieve.
I have some links on that jni (Java Native Interface) at home, but as my java knowledge is less than my python knowledge… Might be of no use. Someone with java knowledge could guide you much better, for sure.
#!/bin/sh
# muCommander startup arguments
MUCOMMANDER_ARGS="@ARGS@"
JAVA_ARGS="@JAVA_ARGS@"
# if JAVA_HOME exists, use it
if [ -x "$JAVA_HOME/bin/java" ]
then
JAVA="$JAVA_HOME/bin/java"
else
if [ -x "$JAVA_HOME/jre/bin/java" ]
then
JAVA="$JAVA_HOME/jre/bin/java"
else
JAVACMD=`which java 2> /dev/null `
if [ -z "$JAVACMD" ] ; then
echo "Error: cannot find java VM."
exit 1
fi
JAVA="java"
fi
fi
# Resolve the path to the installation directory where this script is located in
if [ -h $0 ]
then
# This script has been invoked from a symlink, resolve the link's target (i.e. the path to this script)
BASE_FOLDER=`ls -l "$0"`
BASE_FOLDER=${BASE_FOLDER#*-> }
else
BASE_FOLDER=$0
fi
cd `dirname "$BASE_FOLDER"`
# Starts mucommander.
$JAVA -DGNOME_DESKTOP_SESSION_ID=$GNOME_DESKTOP_SESSION_ID -DKDE_FULL_SESSION=$KDE_FULL_SESSION -DKDE_SESSION_VERSION=$KDE_SESSION_VERSION -Djava.library.path=/usr/local/lib -cp mucommander-0.9.4.jar com.mucommander.main.muCommander $@
Hold it for a while. For Python it does work, and the icon is properly assigned, though I still have to improve integration, it´s going slow as this task needs its time slot. But for python, this Python wrapper does work. That “tutorial” will be updated once the process is completed and fully tested.
For Java, though, I haven´t gone so far, so I would wait to add this to Haikuports. What I posted before does launch a Java application and building with Paladin makes it double clickable and with its icon there. The icon on the deskbar, though, disappears as soon as Java Runtime kicks in. This I´ve already solved for Python, not yet for Java. So once I have the Python stuff complete, will jump to the Java one and once completed, it will be then when I presume will be better to add to Haikuports wiki.
Different issue is that someone wants to take over the Java integration, starting from the previous post, or with a different approach, as I´m not skilled enough to achieve all the goals/milestones I set in the long task list I´ve made, in a short period of time. Nonetheless, As soon as I finish the Python wrapper integration, will go on to the next task in the list.
I woul add the Python one already, as the QtPy based programs sports the basic executable icon right now. So it could be a great GCI task to add icons for those.
Please, do it.
You have to be very strong now, @extrowerk: GCI is no more. Even with the numbers of students and finished task rising every year, Google decided that 10 years is enough.
One useful note for people wanted to run Java based program on haiku: you have to install at least the Dejavu fonts and liberation-fonts to be able to use them correctly, otherwise they will present to you with just squares and squares but no characters at all!
BTW, from my own observation it seemed java based program doesn’t scale on haiku at all. They are very slow and it seemed the multithreading doesn’t work, they also used one cpu core and let other cores idle.
Also because of this multithreading issue, I can’t run the latest version of Netbeans (12.0 LTS) downloaded from Apache on haiku. The whole system become unresponsive and the only way to escape this is shutdown -r.