النتائج 1 إلى 4 من 4

الموضوع: Compiling and Running a Java Program Using the Command Line

  1. #1

    المشرف العام

    تاريخ التسجيل
    Jun 2008
    المشاركات
    4,419
    معدل تقييم المستوى
    1081

    Thumbs up Compiling and Running a Java Program Using the Command Line


    End Google Ads 201810 - BS.net 01 --> Compiling and Running a Java Program Using the Command Line


    1. Optional: Create a new directory where you will store the files for the program. This step is more important if you are using packages. For lab 1, you don't need to worry about packages. But, if you do use packages, you must create a directory tree that matches your package name. For example, if you have a package named "networks.webserver", all files in that package MUST be in a directory named "webserver" that is in a directory named "networks".
    2. Open up your favorite text editor (I like emacs) and write your code. For your first lab, copy and paste the code from the tutorial web page. But, remember that you have a couple of things to modify. You may not be able to fully understand all of the code. We will talk more about sockets in class. But, you should be able to understand enough to modify the necessary portions for the assignment. Use this as an opportunity to learn more about Java!
    3. Save the file. Important: The name of the file must be the class name with a .java extension. If you are writing a class named Test, your file MUST be named Test.java. For your first lab you should save the code as "smtpClient.java".
    4. cd into the directory where your code has been saved. Note: I am assuming that you are not using packages..
    5. Make sure that the java compiler is in your PATH. If you type "javac" and the command is not recognized, the compiler is not in your path. Setting the path depends on a number of things. Let me know if you need help with this.
    6. Compile by typing javac filename where filename is the name of the file. For example, javac smtpClient.java. If the compiler doesn't spit out any errors, it should have generated a ".class" file. Do an "ls" (or "dir" if you are using windows) to verify the class file is there.
    7. Run by typing java classname. For example, java smtpClient. Note: If you are using multiple classes in your program you will need to compile all of the files and then run the program by using the classname of the class that contains your main method.
    8. You should see the output. For lab 1, make sure the output looks correct. To test, you may want to send yourself an email first to make sure that your mail is being sent correctly. Then, modify the code to send the email to my address. Also, take some time to try to figure out what the code is doing. You may not understand every line of it, but don't just copy and paste. I expect you to take some time to understand what's going on.



  • #2
    تقنى مشارك
    تاريخ التسجيل
    Dec 2008
    الدولة
    alexandria
    المشاركات
    55
    معدل تقييم المستوى
    203

    افتراضي رد: Compiling and Running a Java Program Using the Command Line

    السلام عليكم
    اولا انا عايزة بجد اشكرك على الشرح الجامد دة
    بس انا بردة لسة الموضوع مش واضح اوى
    step1
    يا ريت اعرفhow to create directory ?
    step 3
    sure i need your help
    i didn't know what is the
    PATH ?
    اعذرونى انا والله بفهم بس انا لسة مبتدئة فى اول الطريق لسة فى حاجات مش واضحة عندى
    وجزاكم اللة خير عن المساعدة و المجهود الرائع

  • #3
    elfr3on el3ashk الصورة الرمزية A7med Baraka
    تاريخ التسجيل
    Jun 2008
    الدولة
    Egypt - Cairo
    المشاركات
    4,695
    معدل تقييم المستوى
    10

    افتراضي رد: Compiling and Running a Java Program Using the Command Line

    اقتباس المشاركة الأصلية كتبت بواسطة fatma mansour مشاهدة المشاركة
    السلام عليكم
    اولا انا عايزة بجد اشكرك على الشرح الجامد دة
    بس انا بردة لسة الموضوع مش واضح اوى
    step1
    يا ريت اعرفhow to create directory ?
    step 3
    sure i need your help
    i didn't know what is the
    PATH ?
    اعذرونى انا والله بفهم بس انا لسة مبتدئة فى اول الطريق لسة فى حاجات مش واضحة عندى
    وجزاكم اللة خير عن المساعدة و المجهود الرائع
    about how to create dicectory ?
    new folder or new dir its the same

    sorry i didnt know your another Q ??

  • #4
    تقنى مشارك
    تاريخ التسجيل
    Dec 2008
    الدولة
    alexandria
    المشاركات
    55
    معدل تقييم المستوى
    203

    افتراضي رد: Compiling and Running a Java Program Using the Command Line

    شكرا وانا هحاول ادور اكتر عن السؤال التانى

  • معلومات الموضوع

    الأعضاء الذين يشاهدون هذا الموضوع

    الذين يشاهدون الموضوع الآن: 1 (0 من الأعضاء و 1 زائر)

    المواضيع المتشابهه

    1. كتاب جافا Java How to program
      بواسطة A7med Baraka في المنتدى Java - جافا
      مشاركات: 14
      آخر مشاركة: 06-20-2009, 02:45 AM
    2. يا ريت حد يساعدنى فى command line
      بواسطة fatma mansour في المنتدى linux - لينوكس
      مشاركات: 5
      آخر مشاركة: 05-01-2009, 09:35 PM
    3. Java Command Line Arguments In Eclipse IDE
      بواسطة A7med Baraka في المنتدى Java - جافا
      مشاركات: 0
      آخر مشاركة: 11-02-2008, 04:34 AM
    4. Reading a string the user enters at a command-line prompt in Java
      بواسطة A7med Baraka في المنتدى Java - جافا
      مشاركات: 1
      آخر مشاركة: 10-31-2008, 12:30 AM

    الكلمات الدلالية لهذا الموضوع

    مواقع النشر (المفضلة)

    ضوابط المشاركة

    • لا تستطيع إضافة مواضيع جديدة
    • لا تستطيع الرد على المواضيع
    • لا تستطيع إرفاق ملفات
    • لا تستطيع تعديل مشاركاتك
    •  
    "وَقُل رَّبِّ زِدْنِي عِلْمًا"
    أعلانات نصية أستضافة , ريسيلر - Best Hosting | BarakaSoft Web Solutions

    BarakaSoft PageRank RSS RSS 2.0 XML MAP HTML 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 C/C++ | Java | C# | Network | Database | OS | Linux | Windows | Hacker & Security | Photoshop | Flash | Web Development | Free Programs | Mobile App | Free Java Course | Latest Technical News | Internet Programs | Antiviurse Programs | Graphics Programs | Network Programs | Portable Programs | vb Forums Development | Forums Development | CMS(Joomla-nuke-wordpress-mkportal...) | Photo | Anime |