summaryrefslogtreecommitdiff
path: root/cs/Gentoo/tws on asahi arm.md
diff options
context:
space:
mode:
Diffstat (limited to 'cs/Gentoo/tws on asahi arm.md')
-rw-r--r--cs/Gentoo/tws on asahi arm.md95
1 files changed, 95 insertions, 0 deletions
diff --git a/cs/Gentoo/tws on asahi arm.md b/cs/Gentoo/tws on asahi arm.md
new file mode 100644
index 0000000..4a677cb
--- /dev/null
+++ b/cs/Gentoo/tws on asahi arm.md
@@ -0,0 +1,95 @@
+The key insight is that TWS is fundamentally a Java application with platform-agnostic JAR files. While the TWS installer is x86-only and won't run on ARM64, the compiled Java bytecode will run perfectly on any ARM64 Java Virtual Machine. The strategy is:
+
+- Install TWS on an x86-64 machine and extract the JAR files
+
+- Install native ARM64 Java on your Gentoo Asahi system
+
+- Copy the JAR files and launch TWS using the native JVM
+
+
+
+sudo emerge -av dev-java/openjdk-bin:11
+java -version
+eselect java-vm list
+
+tar -czf Jts.tar.gz Jts/
+
+scp username@x86machine:~/Jts.tar.gz ~/.local/
+
+tar -xzf Jts.tar.gz
+ls -la ~/.local/Jts/
+
+# create launch script
+
+vim .local/bin/ib-tws
+
+## 1
+#!/bin/bash
+set -euo pipefail
+
+# TWS Launch Script for ARM64 Native Java
+
+JTS_DIR="${HOME}/Jts"
+cd "${JTS_DIR}" || { echo "Directory $JTS_DIR does not exist!"; exit 1; }
+
+JTS_DIR="${HOME}/.local/Jts/1041/jars"
+CLASSPATH=$(printf ":%s" "${JTS_DIR}"/*.jar)
+CLASSPATH=${CLASSPATH:1}
+
+export HOME="$HOME" # For possible relative lookups
+JTS_DIR="$HOME/.local/Jts"
+cd "$JTS_DIR"
+
+# List of required JARs (adjust as needed for your version)
+JARS=(
+ jts.jar
+ total.jar
+ hsqldb.jar
+ jcommon-1.0.16.jar
+ jfreechart-1.0.13.jar
+ jhall.jar
+ other.jar
+ rss.jar
+ pluginsupport.jar
+)
+
+CLASSPATH=$(IFS=:; echo "${JARS[*]}")
+
+# Check that all JARs exist
+for JAR in "${JARS[@]}"; do
+ if [[ ! -f "$JAR" ]]; then
+ echo "Missing JAR file: $JAR"
+ exit 1
+ fi
+done
+
+echo "Launching TWS..."
+#Use : as the classpath separator on Linux (Windows uses ;)
+exec java \
+ -cp "${CLASSPATH}" \
+ -Dsun.java2d.noddraw=true \
+ -Dsun.java2d.xrender=false \
+ -Dswing.boldMetal=false \
+ -Dsun.locale.formatasdefault=true \
+ -Xmx1024M \
+ -XX:MaxPermSize=256M \
+ jclient.LoginFrame .
+
+
+### The exact JAR filenames (especially total.jar, jcommon-*.jar, jfreechart-*.jar) vary by TWS version - ls ~/Jts/*.jar
+
+# export GDK_BACKEND=x11 probably needed in script
+
+chmod +x
+
+## Dependencies
+
+# On Gentoo, ensure basic fonts are installed
+sudo emerge -av media-fonts/dejavu media-fonts/liberation-fonts
+# Rebuild font cache
+fc-cache -fv
+
+
+The default -Xmx1024M allocates 1GB heap. Adjust based on your needs and M2's 8GB total RAM:
+# For more intensive use
+-Xmx2048M -XX:MaxPermSize=512M