Chat4J

Chat4J is a Java 21 desktop client for cloud, OAuth, and local AI providers. It supports streaming responses, local conversation storage, Agent Mode, speech input, and read aloud. The Swing UI uses FlatLaf with bundled IntelliJ themes. Transcripts render through native System WebViews via SwingWebView, Chromium via jcefmaven / JCEF, or Swing.
Install or run
Download the .dmg, .msi, .deb, or shaded JAR from GitHub Releases. For the JAR distribution, also download both openhtmltopdf-*.jar assets and keep them beside chat4j-<version>.jar; run it with java --enable-preview -jar chat4j-<version>.jar. Release artifacts are currently unsigned, so macOS or Windows may show a first-launch warning. See release artifact verification before bypassing it.
Run from source with Java 21 and Maven:
mvn clean compile
mvn exec:java
First run on macOS
If Gatekeeper blocks Chat4J, Control-click Chat4J.app in Finder, choose Open, then confirm Open. If it remains blocked, use System Settings → Privacy & Security → Open Anyway.
Terminal alternative:
xattr -dr com.apple.quarantine /Applications/Chat4J.app
open /Applications/Chat4J.app
First run on Windows
If SmartScreen blocks Chat4J, click More info → Run anyway. If the installer is marked as blocked, right-click it, choose Properties, check Unblock on the General tab, then click Apply.
Providers
- API key: Anthropic, Gemini, OpenAI, Perplexity, OpenRouter, Together, Groq, DeepSeek, Mistral, xAI, ElevenLabs, ListenHub, Speechify, Deepgram, and AssemblyAI
- OAuth: OpenAI Codex and GitHub Copilot
- Local: Ollama, LM Studio, Whisper.cpp, and Vosk
Add API keys in Settings or through provider environment variables such as OPENAI_API_KEY. Settings tokens take precedence and are stored in Chat4J’s encrypted local vault, not an OS keychain.
Development
mvn test
mvn clean package
License
Apache License 2.0
评论