Thursday, February 23, 2012

HOW TO INSTALL AND WORK JAVA PROGRAMS IN FEDORA

HOW TO INSTALL "JAVA" COMPILER IN FEDORA
STEP 1: Open your fedora Terminal window.
STEP 2: Connect Internet to your System.
STEP 3: Then type this commands.
LOG IN TO ROOT USER:
  Syntax: $su – (or) $su
  Syntax: $password: enter your root password.
  Syntax: [root-@local host]#
STEP 4: INSTALL JAVA COMPILER OR JDK COMPILER:
  Syntax: [root-@local host]#$yum install java-1.7.0-openjdk
STEP 5: Display the available packages.
STEP 6: Then install JAVA compiler.
STEP 7: Finish the installation.


HOW TO WORK "JAVA" PROGRAMS IN FEDORA:
STEP 1Open your Fedora Terminal window.
STEP 2: Then type this commands.
  Syntax: $vi sample.java then enter.
STEP 3open the vi editor window.
STEP 4: Pres the insert "i" button.
STEP 5: Then type your "JAVA" Program.
    import java.io.*;
      class sample
       {
               public static void main(String args[])
            {
              System.out.println("Hello world");
            }
       }
NOTE: Using Netbeans also we can Run the Java programs.

HOW TO WORK "NETBEANS" IN FEDORA:
STEP 1: Open Terminal window.
  Syntax: #yum install netbeans
STEP 2: Display the available packages.
STEP 3: Then install netbeans software
STEP 4: Finish the installation.


HOW TO COMPILE "JAVA" PROGRAMS IN FEDORA:
STEP 1: Compile your "JAVA" program.
  syntax: $javac sample.java
STEP 2: Find errors and correct the errors. 
STEP 3: Then save and close.


HOW TO RUN "JAVA" PROGRAMS IN FEDORA:
STEP 1Type this command and run your "JAVA" program.
  syntax: $java sample
  output: Hello world
STEP 2: Close the terminal window.





1 comment:

  1. Use of "Class sample"
    isn't accepted by my javac.

    I have to use "class sample"

    ReplyDelete