{"id":42149284,"url":"https://github.com/sepe81/tennis","last_synced_at":"2026-01-26T18:14:30.412Z","repository":{"id":2788537,"uuid":"47455577","full_name":"sepe81/tennis","owner":"sepe81","description":"Simple Java Swing based tennis (ping-pong-style)","archived":false,"fork":false,"pushed_at":"2026-01-10T17:58:18.000Z","size":471,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-11T05:23:59.396Z","etag":null,"topics":["gradle","java","learning","rmi","swing"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sepe81.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2015-12-05T12:48:12.000Z","updated_at":"2026-01-10T17:58:02.000Z","dependencies_parsed_at":"2023-07-05T17:16:13.900Z","dependency_job_id":"cb9cf0a6-e82d-48b4-bd06-69abefabcf03","html_url":"https://github.com/sepe81/tennis","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sepe81/tennis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sepe81%2Ftennis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sepe81%2Ftennis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sepe81%2Ftennis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sepe81%2Ftennis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sepe81","download_url":"https://codeload.github.com/sepe81/tennis/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sepe81%2Ftennis/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28784093,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T13:55:28.044Z","status":"ssl_error","status_checked_at":"2026-01-26T13:55:26.068Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gradle","java","learning","rmi","swing"],"created_at":"2026-01-26T18:14:26.379Z","updated_at":"2026-01-26T18:14:30.402Z","avatar_url":"https://github.com/sepe81.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tennis\n\nSimple Java Swing based tennis (ping-pong-style)\n\nThis is a simple demo with an optional RMI based gaming server.\n\nBack in 2003 it started as a learning project under Java 5 with an Apache Ant `build.xml`.\nLater I added an Apache Maven `pom.xml` and now it also supports a Gradle `build.gradle` build.\n\n## Requirements\n\n### To Build:\n- **Java 17 or later** (required by Gradle 9.2.0)\n- Gradle wrapper included (`gradlew`)\n\n### To Run:\n- **Java 8 or later** (the compiled JAR is Java 8 compatible)\n\n**Note:** While the project compiles to Java 8 bytecode (source/target compatibility 1.8), you need Java 17+ installed to run the Gradle build process.\n\n## Building the Project\n\n### Using Gradle (recommended)\n\n```bash\n./gradlew build\n```\n\nThis will:\n- Compile all Java sources\n- Run unit tests\n- Create a fat JAR file in `build/libs/tennis-1.0.0-SNAPSHOT.jar` (includes all dependencies)\n\n### Using Maven\n\n```bash\nmvn clean package\n```\n\n### Using Ant\n\n```bash\nant compile\nant jar\n```\n\n## Running the Application\n\n### Local Game (Single Machine, Two Players)\n\nPlay tennis with two players on the same computer using keyboard controls.\n\n**Using the JAR file:**\n```bash\n./gradlew jar\njava -jar build/libs/tennis-1.0.0-SNAPSHOT.jar\n```\n\nThe JAR file is a \"fat JAR\" that includes all dependencies (TableLayout, SLF4J, Logback), so it can be run standalone.\n\n**How to play:**\n1. Select `Game → Login` from the menu\n2. Enter a player name\n3. Use keyboard controls:\n   - **Player 1**: Arrow keys (↑/↓/←/→)\n   - **Player 2**: Page Up/Page Down/F1/F2\n\n### Remote Game (RMI-based Multiplayer)\n\nPlay tennis over the network using Java RMI.\n\n#### Step 1: Start the RMI Server\n\nOn the server machine:\n\n```bash\n./gradlew jar\njava -cp build/libs/tennis-1.0.0-SNAPSHOT.jar de.sepe.tennis.remote.server.ServerImpl\n```\n\n(Note: Use `-cp` not `-jar` since we need to specify the main class)\n\nYou should see:\n```\nRMI registry created on port 1099\ntennisServer bound in registry\nServer ready and waiting for connections...\nPress Ctrl+C to stop.\n```\n\nThe server will:\n- Create an RMI registry on port 1099\n- Bind the tennis server as \"tennisServer\"\n- Keep running until you press Ctrl+C\n\n#### Step 2: Start the Client(s)\n\nOn the client machine(s):\n\n```bash\n./gradlew jar\njava -cp build/libs/tennis-1.0.0-SNAPSHOT.jar de.sepe.tennis.remote.gui.Tennis\n```\n\n**Note:** If the server is on a different machine, you'll need to update the hardcoded localhost reference in `Court.java:166` to point to the server's IP address or hostname.\n\n## Architecture\n\nThe project contains two separate implementations:\n\n### Local Package (`de.sepe.tennis.local`)\n- Single-machine game\n- Two players share one keyboard\n- All game logic runs locally\n- Classes: `Tennis`, `Court`, `Player`, `Ball`, `Controller`\n\n### Remote Package (`de.sepe.tennis.remote`)\n- Network-based multiplayer using Java RMI\n- Server manages game sessions\n- Clients connect to play\n- Classes:\n  - Server: `ServerImpl`, `Session`, `Player`, `Ball`\n  - Client: `Tennis`, `Court`, `PlayerView`, `BallView`\n  - Interfaces: `Server` (RMI remote interface)\n\n## Troubleshooting\n\n### RMI Registry Issues\n\nIf you see `Connection refused to host` errors:\n- Make sure the server is running first\n- Check that a firewall does not block port 1099\n- The server creates its own RMI registry, so you don't need to run `rmiregistry` separately\n\n### ClassNotFoundException with RMI\n\nThis is fixed in the current version.\nThe server creates the RMI registry in the same JVM, ensuring all classes are available.\n\n**Note:** RMI stub classes are generated dynamically at runtime (since Java 5), so no explicit stub generation step is needed.\n\n## Build Systems\n\nThe project supports three build systems for historical reasons:\n\n- **Gradle** (`build.gradle`) - Recommended, most modern\n- **Maven** (`pom.xml`) - Alternative build system\n- **Ant** (`build.xml`) - Legacy build system from 2003\n\nAll three should produce equivalent results.\n\n## License\n\nCopyright © 2003 Sebastian Peters. All Rights Reserved.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsepe81%2Ftennis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsepe81%2Ftennis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsepe81%2Ftennis/lists"}