Run archived Cut-the-Knot Java applets locally from their original web pages.
Give ctk-applet a Cut-the-Knot page URL, and it will find the applets on that page,
prepare a local launcher file, and open the selected applet with Java's appletviewer.
- What this is for
- What most users need
- Requirements
- Install Java 8
- Install ctk-applet
- Quick start
- How selection works
- Commands
- What each command does
- FAQ
- Acknowledgements
This tool is for old Java applets from the Cut-the-Knot archive.
Because these applets use the old Java applet system, you need a Java 8 JDK
with appletviewer. A newer JDK is not enough.
-
Install Java 8 JDK
-
Make sure
appletviewerworks from a terminal -
Download
ctk-applet -
Run:
ctk-applet setup ctk-applet run https://www.cut-the-knot.org/ctk/May2001.shtml --name SilverDollar
- Java 8 JDK
appletvieweravailable inPATH
Install a Java 8 JDK that still includes appletviewer.
Use your distribution packages when available.
Ubuntu/Debian:
sudo apt install openjdk-8-jdk
Arch Linux:
sudo pacman -S jdk8-openjdk
Fedora:
sudo dnf install java-1.8.0-openjdk-devel
openSUSE:
sudo zypper install java-1_8_0-openjdk-devel
You can also use SDKMAN instead of system packages:
curl -s "https://get.sdkman.io" | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"
sdk list java
sdk install java 8.0.482-tem
With Homebrew:
brew install --cask temurin@8
Or with SDKMAN:
curl -s "https://get.sdkman.io" | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"
sdk install java 8-tem
Install a Java 8 JDK such as Eclipse Temurin 8, then make sure appletviewer
is available in PATH.
Download the binary for your platform from the Releases page.
If you already have Rust installed, you can also run the script directly.
Prepare the local Java class archive once:
ctk-applet setup
List the applets found on a page:
ctk-applet list https://www.cut-the-knot.org/ctk/May2001.shtml
Show details for one applet:
ctk-applet show https://www.cut-the-knot.org/ctk/May2001.shtml --index 1
Run one applet directly from the page URL:
ctk-applet run https://www.cut-the-knot.org/ctk/May2001.shtml --name SilverDollar
Save launcher files for later use:
ctk-applet save https://www.cut-the-knot.org/ctk/May2001.shtml --all
Run a previously saved launcher:
ctk-applet run-file saved/may2001/02-SilverDollar.html
If a page contains exactly one applet, show, save, and run can be used
without --index or --name.
If a page contains several applets, choose one explicitly with either:
--index N--name CODE
ctk-applet setup
ctk-applet list <url>
ctk-applet show <url> [--index N | --name CODE]
ctk-applet save <url> [--all | --index N | --name CODE] [--out-dir PATH]
ctk-applet run <url> [--index N | --name CODE]
ctk-applet run-file <path>
setupdownloadsclasses.zipwhen needed and extracts the localclasses/directorylistshows the applets found on a pageshowprints the applet information for one selected appletsavewrites launcher HTML files tosaved/<page-slug>/runcreates a temporary launcher file and opens it withappletviewerrun-fileopens a previously saved launcher file
No. ctk-applet is an independent utility and is not affiliated with or endorsed by Cut-the-Knot.
I came to Cut-the-Knot while looking into take-away game variations and found a remarkable collection of games, applets, and mathematical writing. But the archived applets were no longer easy to run, and it was clear from user discussions that many people did not know how to make them work locally.
This tool was made to help bridge that gap: a small, reliable, and easy-to-use way to run those applets again from their original page URLs.
These applets use the old Java applet system and need appletviewer,
which is part of a Java 8 JDK. A newer JDK is not enough here.
setup prepares the local classes/ directory used by many archived applets.
Make sure you installed a Java 8 JDK, not just a JRE or a newer JDK,
and that appletviewer is available in PATH.
It uses the published Cut-the-Knot Java class archive,
which mirrors the site's historical classes/ directory.
For background, see Help with Java.
Yes, as long as the local classes/ directory stays in place relative to them.
With appreciation for Cut-the-Knot and for the work of Alexander Bogomolny, whose writing and interactive applets made mathematics unusually vivid and approachable.