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: $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
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 1: Open your Fedora Terminal window.
Syntax: $vi sample.java then enter.
STEP 3: open 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 1: Type this command and run your "JAVA" program.
syntax: $java sample
output: Hello world
STEP 2: Close the terminal window.
Use of "Class sample"
ReplyDeleteisn't accepted by my javac.
I have to use "class sample"