Hello,
I have created a file named Aptfile with the package name of the JDK I want to install (openjdk-21-jdk-headless). But the “java” command-line is not in the PATH environment variable. I found it under “/layers/digitalocean_apt/apt/usr/lib/jvm/java-21-openjdk-amd64/bin”. But when I run my java JAR file, I always get the following error, whatever I do :
error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.InternalError: Error loading java.security file
Why don’t Aptfile never fully installs real Debian packages? I tried to install “language-pack-fr” too but the language is never built and activated.
Is Aptfile supposed to install packages from Debian or what ? What is the purpose of Aptfile ? Why packages get installed into “/layers” ??? What can I do to correctly install additional Linux packages ???
Thank you,
Claude Petit Senior Developer
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hey Claude!
The
Aptfile
does install Debian packages, but App Platform uses buildpacks under the hood (just like Heroku), and the packages from yourAptfile
get installed into a special layer (that’s the/layers/...
path you’re seeing).Java is there, but you might have to manually add it to your PATH in your
start
command or your app config. Something like:As for
language-pack-fr
, same issue, those kinds of system-level changes (like locales) might not work as expected in this environment, because it’s not a full VM. App Platform runs in containers with strict buildpack layers, so some things just don’t fully apply.You could use a Dockerfile to deploy your app so you could install any of the packages that you need:
Alternatively you could use a Droplet where you have full root access:
Hope that this helps.
- Bobby