blob: 4a677cb2e088232832c919ef46f7a5e0fe049ef6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
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
|