{ "id": "loyA61WU1pQrcxuH", "createdBy": "15sg55Z9lOgM", "dateCreated": 1713192447954, "name": "Lab-Linux: Java-Programming", "meta": { "logo": "https://raw.githubusercontent.com/edrys-labs/lab-linux/main/media/java.jpg", "description": "In this Java programming course, students will embark on an exciting journey into the world of coding. They'll start by learning the basics of Java, a versatile and widely used programming language. By creating simple programs like \"Hello, World!\" and gradually introducing more complex elements such as input from users, students will develop essential programming skills. Additionally, they will learn to identify and fix common errors, enhancing their problem-solving abilities.", "selfAssign": true, "defaultNumberOfRooms": 0 }, "members": { "teacher": [], "student": [] }, "modules": [ { "url": "https://raw.githubusercontent.com/edrys-labs/module-markdown-it/2.0.0/index.html", "config": "# Welcome to Lab-Linux: Java-Programming\n\nJava is a popular programming language that acts like a universal translator for computers, helping them understand what we want them to do.\nIt’s kind of like the language you use to build awesome structures in a virtual world, except these structures are programs and apps that work in the real world!\n\nHere’s why Java is awesome for young programmers:\n\n1. **Write once, run anywhere**:\n Java is super special because you can write your program once, and it can run on almost any device, whether it's a computer, a smartphone, or even a smart fridge!\n\n2. **Easy to learn basics**:\n Java has a straightforward way of doing things, which makes it easy to start learning.\n It’s like playing with building blocks; once you know how a few basic blocks fit together, you can start building more complicated stuff.\n\n3. **Helps you think like a programmer**:\n Learning Java teaches you to think logically and solve problems, just like puzzles. It trains your brain to organize thoughts and tackle problems in smart, efficient ways.\n\n4. **Used everywhere**:\n Java is used by big companies all around the world to create games, social media apps, and all sorts of useful software.\n So, learning Java might help you create your own game or app one day!\n\nJava is not just about coding; it’s a way to express your ideas and see them come to life in the digital world. It’s a powerful tool that can open up endless opportunities for creating and innovating!\n\n__Visit a station by clicking onto it and then explore the terminal ;-)__", "studentConfig": "", "teacherConfig": "## Welcome for Teachers\n> This can be used as a base laboratory to create further and more elaborate labs with [edrys-Lite](https://edrys-labs.github.io).\n> You are currently in the Lobby. If there is a station available you can switch to it and try out the terminal.\n> Otherwise, if you are in teacher-mode you can share a lab by clicking onto `setting` >> `station` and then by clicking the presented link,\n> which is the same as the current link, but only with the word `station` instead of `classroom`.", "stationConfig": "", "showInCustom": "lobby", "width": "full", "height": "huge" }, { "url": "https://edrys-labs.github.io/module-editor/index.html", "config": { "editorText": "Starting text in editor...", "runCommand": "execute", "language": "cpp", "theme": "light" }, "studentConfig": "", "teacherConfig": "", "stationConfig": "", "showInCustom": "station", "width": "full", "height": "medium" }, { "url": "https://raw.githubusercontent.com/edrys-labs/module-markdown-it/2.0.0/index.html", "config": "# Welcome to the Station\n\n## Tutorial Part 1: Your First Java Program\nLet's start with something simple. We're going to write a program that tells the computer to say \"Hello, World!\". This is a traditional first step in learning any programming language.\n1. **Type or copy the following Java code into the editor**:\n\n ```java\n public class HelloWorld {\n public static void main(String[] args) {\n System.out.println(\"Hello, World!\");\n }\n }\n ```\n\n2. **Run the program**:\n Press the run button in your online editor.\n You should see the output `Hello, World!` appear on the screen.\n Congratulations, you've just written and run your first Java program!\n\n## Tutorial Part 2: Enhancing Your Program\nNow, let's make your program a bit more interactive. We'll modify it so it asks for your name and then says hello to you personally.\n1. **Modify your program**:\n Change the code in your online editor to the following:\n\n ```java\n import java.util.Scanner; // This line imports the Scanner class for reading input\n\n public class HelloWorld {\n public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in); // Create a Scanner object to read input\n System.out.println(\"Enter your name: \"); // Ask for user's name\n String name = scanner.nextLine(); // Read user input\n\n System.out.println(\"Hello, \" + name + \"!\"); // Say hello to the user\n }\n }\n ```\n\n2. **Run the program**:\n When you run this program, it will ask you to enter your name.\n Type your name into the input box and press enter.\n You should see a message saying hello to you!\n\n#### Tutorial Part 3: Introduce an Error\nLet's introduce a common error so you can learn how to identify and fix it.\n1. **Introduce an error**:\n Change the line that creates the Scanner object slightly:\n\n ```java\n Scanner scanner = new Scanner(System.in);\n ```\n\n Change it to:\n\n ```java\n Scanner scanner = new Scnner(System.in); // Misspelled 'Scanner'\n ```\n\n2. **Run the program and observe the error**:\n When you try to run your program, you'll get an error message like `error: cannot find symbol`.\n This error occurs because `Scnner` is not recognized by Java (because we misspelled it).\n\n3. **Fix the error**:\n Correct the spelling of `Scanner` in the instantiation of the `scanner` object.\n Run the program again to see it working perfectly.\n\nThrough these steps, students not only learn how to write and run Java programs but also how to troubleshoot and resolve simple errors, which are important skills in programming.\n ", "studentConfig": "", "teacherConfig": "", "stationConfig": "## Instructions for Station-Sharing \n\nYou are currently responsible for sharing a station of this lab.\nYou have multiple options to share a or your terminal.\nTherefor we use the pyxtermjs - terminal server from:\n\nhttps://github.com/edrys-labs/module-pyxtermjs\n\n### Using Docker\n\nIf you haven't done it so far, install [docker](https://docs.docker.com/engine/install/).\nOr, follow one of the instruction-videos for your system:\n\n<details>\n<summary>Install Docker on Linux</summary> \n<iframe\n style=\"width: 100%; aspect-ratio: 16 / 9\"\n src=\"https://www.youtube.com/embed/cqbh-RneBlk?si=juvUM5d2OSZ28WBv\"\n title=\"YouTube video player\"\n frameborder=\"0\"\n allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\"\n referrerpolicy=\"strict-origin-when-cross-origin\"\n allowfullscreen></iframe>\n</details>\n\n<details>\n<summary>Install Docker on Windows</summary>\n<iframe\n style=\"width: 100%; aspect-ratio: 16 / 9\"\n src=\"https://www.youtube.com/embed/WDEdRmTCSs8?si=X0agStn1akNcZLGu\"\n title=\"YouTube video player\"\n frameborder=\"0\"\n allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\"\n referrerpolicy=\"strict-origin-when-cross-origin\"\n allowfullscreen></iframe>\n</details>\n\n<details>\n<summary>Install Docker on MacOS</summary>\n<iframe\n style=\"width: 100%; aspect-ratio: 16 / 9\"\n src=\"https://www.youtube.com/embed/-EXlfSsP49A?si=OZ_l4_2hDKb6ULQ_\"\n title=\"YouTube video player\"\n frameborder=\"0\"\n allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\"\n referrerpolicy=\"strict-origin-when-cross-origin\"\n allowfullscreen></iframe>\n</details>\n\nThen the only thing that is required is to run the following command:\n\n```bash\ndocker run -it -p 5000:5000 crosslab/edrys_pyxtermjs_development:latest\n```\n\nThis will download the pyxtermjs terminal-server from docker-hub and run it in a secure environment.\nIt contains support for:\n\n- `clojure`\n- `g++`\n- `gcc`\n- `golang`\n- `haskell`\n- `java`\n- `lua`\n- `mono`\n- `nodejs`\n- `python 3`\n- `r`\n- `rustc`\n\n### Using Python\n\nYou can also share your terminal directly via Python, visit the following project\n\nhttps://github.com/edrys-labs/module-pyxtermjs\n\n... the easiest way is to perform the following steps:\n\n``` bash\n# 1. clone the repository or download the folder manually\ngit clone https://github.com/edrys-labs/module-pyxtermjs\n\n# 2. install all required sources\npip3 install -r requirements.txt\n\n# 3. run the terminal-server\npython3 -m pyxtermjs --cors True --command bash --port 5000\n```", "showInCustom": "station", "width": "half", "height": "huge" }, { "url": "https://edrys-labs.github.io/module-pyxtermjs/index.html", "config": "", "studentConfig": "", "teacherConfig": "", "stationConfig": { "server": "http://localhost:5000/pty", "execute": "execute", "script": "echo $CODE | base64 --decode > HelloWorld.java\njavac HelloWorld.java && java HelloWorld", "enable": { "teacher": true, "student": true } }, "showInCustom": "station", "width": "full", "height": "medium" } ] }