إنشاء تطبيقك الأول
أنشئ تطبيقًا أساسيًا يعرض عبارة 'Hello World' باستخدام Spring Initializr واستكشف بنية المشروع
إنشاء تطبيقك الأول درس مجاني في Spring Boot 4 Complete Guide على CoddyKit. هذا هو الدرس 2 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Spring Boot 4 Complete Guide، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Spring Boot 4 Complete Guide 4 دروس في المجموع.
بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.
Your First Spring Boot App
Time to build your first app! You'll use Spring Initializr to scaffold a project, then create a simple Hello World and explore its structure.
Meet Spring Initializr
Spring Initializr is a project wizard for Spring. Pick your build tool, language, and version, and it generates the boilerplate so you don't have to.
Launching Initializr
Open Spring Initializr at start.spring.io in your browser. IntelliJ and Eclipse also bundle it right into their New Project dialog.
Project Details
In Initializr you set the basics: build tool (Maven), language (Java), Spring Boot version, plus Group and Artifact to name your project and package.
Core Dependencies
Dependencies are the libraries your app needs. Add Spring Web — it brings everything for web apps, including an embedded Tomcat. Search and add it now.
Generate & Open
Hit Generate to download a zip, unzip it, and import it into your IDE. It'll recognize the Maven project and set things up automatically.
Exploring Your Project
Know your layout: src/main/java for code, src/main/resources for config and assets, src/test/java for tests, and pom.xml for dependencies and build settings.
The Core Class
Your main class is the entry point. It carries @SpringBootApplication and a standard main method that calls SpringApplication.run() to boot the app.
Run Your First App!
Let's print a message at startup using a CommandLineRunner — a component that runs your code right after the application context loads.
package com.example.myfirstapp;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
@SpringBootApplication
public class MyfirstappApplication {
public static void main(String[] args) {
SpringApplication.run(MyfirstappApplication.class, args);
}
@Bean
public CommandLineRunner run(String... args) throws Exception {
return args -> System.out.println("Hello CoddyKit!");
}
}Project Structure Check
Which of these files/folders is typically found in a newly generated Spring Boot project and is used to define its dependencies?
Recap: Your First App
Done! You scaffolded a project with Spring Initializr, added Spring Web, explored the structure, and printed Hello World via a CommandLineRunner. Next: auto-configuration in depth.
تعلم Java مع معلم ذكاء اصطناعي — مجانًا
اكتب وقم بتشغيل أكوادك الفعلية في المتصفح، واحصل على مساعدة فورية من معلم ذكاء اصطناعي متاح 24/7، واستمر من حيث توقفت على الويب أو في التطبيق.
- الدورات
- 21
- الدروس
- 84
الأسئلة الشائعة
هل درس «إنشاء تطبيقك الأول» مجاني؟
نعم — نص درس «إنشاء تطبيقك الأول» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Spring Boot 4 Complete Guide، انتقل إلى CoddyKit PRO. تتضمن دورة Spring Boot 4 Complete Guide 4 دروس في المجموع.
ماذا ستتعلم في «إنشاء تطبيقك الأول»؟
أنشئ تطبيقًا أساسيًا يعرض عبارة 'Hello World' باستخدام Spring Initializr واستكشف بنية المشروع تتمرن على Spring Boot 4 Complete Guide مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.
هل أحتاج إلى خبرة سابقة لأبدأ Spring Boot 4 Complete Guide؟
لا تُشترط خبرة سابقة. Spring Boot 4 Complete Guide على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 2 من أصل 4.
كم من الوقت يستغرق درس «إنشاء تطبيقك الأول»؟
معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.
هل يمكنني كتابة وتشغيل أكواد في درس Spring Boot 4 Complete Guide هذا؟
نعم. كل درس في Spring Boot 4 Complete Guide يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.