liquid
liquid
LTLeaning Technologies
Created by liquid on 11/30/2024 in #support
Verbose compilation
Anyway to develop a progress bar for the compilation process? I found "preloadProgress" in CheerpJ docs for the init function but I'm pretty sure it doesn't provide information about how far the browser is with compiling the program.
1 replies
LTLeaning Technologies
Created by liquid on 11/19/2024 in #support
Java Compilation on CheerpX and not CheerpJ
Hey i'm new to using Cheerpx, and I think its super cool! I've been playing around with my fork of https://github.com/leaningtech/webvm and seeing how I can change the Dockerfile. My current objective is to have Java work on my container. While I could just use Cheerpj, I wanted to be able to support user input through Scanner (and as far as I know, this isn't supported with CheerpJ) and also have more file flexibility. Has anyone figured out how to do it? Here's my Dockerfile:
FROM --platform=i386 i386/debian:buster

ARG DEBIAN_FRONTEND=noninteractive

# Install required packages
RUN apt-get clean && apt-get update && apt-get -y upgrade && \
apt-get -y install apt-utils \
python3 unzip nodejs \
fakeroot dbus base hexedit \
patch ucf file dialog curl \
less nano openjdk-11-jdk-headless openjdk-11-jre-headless && \
apt-get clean && rm -rf /var/lib/apt/lists/*

# Set environment variables for JVM compatibility
ENV JAVA_HOME="/usr/lib/jvm/java-11-openjdk-i386"
ENV PATH="${JAVA_HOME}/bin:$PATH"
ENV LD_LIBRARY_PATH="${JAVA_HOME}/lib/server:$LD_LIBRARY_PATH"

# These are just some random things I was trying to get it to work. I've been losing my mind.
ENV JAVA_TOOL_OPTIONS="-XX:+UnlockExperimentalVMOptions -XX:+UseContainerSupport -XX:ActiveProcessorCount=1 -XX:-UseContainerCpuShares -XX:-UseContainerSupport -Djava.awt.headless=true"

RUN useradd -m user && echo "user:password" | chpasswd
COPY --chown=user:user ./examples /home/user/examples

WORKDIR /home/user/
ENV HOME="/home/user" TERM="xterm" USER="user" SHELL="/bin/bash" EDITOR="vim" LANG="en_US.UTF-8" LC_ALL="C"

RUN echo 'root:password' | chpasswd

# Default command
CMD [ "/bin/bash" ]

# RUN IMAGE AS 950M
FROM --platform=i386 i386/debian:buster

ARG DEBIAN_FRONTEND=noninteractive

# Install required packages
RUN apt-get clean && apt-get update && apt-get -y upgrade && \
apt-get -y install apt-utils \
python3 unzip nodejs \
fakeroot dbus base hexedit \
patch ucf file dialog curl \
less nano openjdk-11-jdk-headless openjdk-11-jre-headless && \
apt-get clean && rm -rf /var/lib/apt/lists/*

# Set environment variables for JVM compatibility
ENV JAVA_HOME="/usr/lib/jvm/java-11-openjdk-i386"
ENV PATH="${JAVA_HOME}/bin:$PATH"
ENV LD_LIBRARY_PATH="${JAVA_HOME}/lib/server:$LD_LIBRARY_PATH"

# These are just some random things I was trying to get it to work. I've been losing my mind.
ENV JAVA_TOOL_OPTIONS="-XX:+UnlockExperimentalVMOptions -XX:+UseContainerSupport -XX:ActiveProcessorCount=1 -XX:-UseContainerCpuShares -XX:-UseContainerSupport -Djava.awt.headless=true"

RUN useradd -m user && echo "user:password" | chpasswd
COPY --chown=user:user ./examples /home/user/examples

WORKDIR /home/user/
ENV HOME="/home/user" TERM="xterm" USER="user" SHELL="/bin/bash" EDITOR="vim" LANG="en_US.UTF-8" LC_ALL="C"

RUN echo 'root:password' | chpasswd

# Default command
CMD [ "/bin/bash" ]

# RUN IMAGE AS 950M
When the vm is deployed and I run java -version in the browser, I get this message:
Error occurred during initialization of VM
getcpu(2) system call not supported by kernel
Error occurred during initialization of VM
getcpu(2) system call not supported by kernel
Running javac hangs indefinitely. I would very much appreciate help!
2 replies