This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Linux / UNIX and the fly likes Procedure to Execute Programs in Fedora Linux Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "Procedure to Execute Programs in Fedora Linux" Watch "Procedure to Execute Programs in Fedora Linux" New topic
Author

Procedure to Execute Programs in Fedora Linux

Badri Prasad
Greenhorn

Joined: Aug 28, 2007
Posts: 3
Dear All,

I have installed fedora linux version 6, but i donno how to execute the Java programs in Fedora Linux. If anyone has the procedure for the same pls give me the link or some useful details regarding the same.

Thnx
Badri
SCJP - 1.5 preparation
[ September 30, 2007: Message edited by: Badri Prasad ]
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8935
    
    9

The same way you execute a java program on every other platform:


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11490
    
  95

Badri,

We would love to help you, but you need to show some effort, and tell the details.

Right now:
  • we can't tell if you have been given an executable jar file to run, a compiled class file, or whether you are working with the source code.
  • we can't tell if you are comfortable with working from a shell (and if so, are you using the bash shell) or are you looking at the X Windows System (probably running the Gnome window manager since that is default on Fedora Core 6) and trying to work out what to do next
  • we can't work out whether you are using the JDK that comes with Fedora Core 6 (GCJ - roughly equal to Sun's JDK version 1.4) or whether you have installed a later version (hopefully from Sun's site).
  • we can't tell whether you are familiar with editing files on Linux systems - are you happy to use vim or emacs (or their X11 equivalents) or kedit or kate or ....?

  • Do you see why it is so hard to even start helping you?

    As an aside, some people look at these sorts of issues and try and claim that Linux is a failure. Not so. The first point would still have to be established before we could begin. The 2nd and last points become slightly easier under Microsoft Windows since they do not give you options - you will use cmd.exe, and notepad.exe is the only consistent editor we can talk about. And since Microsoft do not distribute anything like a Java compiler, you will have had to have downloaded from Sun - whereas Linux tries to give you a Java compiler from the moment you complete your installation, even if it is not the official release.

    Regards, Andrew


    The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
    Badri Prasad
    Greenhorn

    Joined: Aug 28, 2007
    Posts: 3
    Hi Andrew, Thank you very much for your reply,

    First of all for your first question, I m trying to execute compiled class file and i m working in vim and i know very little about linux file system cos i m very new to that OS, do i have to install JDK in Linux cos when i gave command Javac HelloWolrd.java it could not compile the same. I think this post is clear to help me, if this is not clear pls tel me i will try to give you more details on the same.

    Thnx
    Badri
    Joe Ess
    Bartender

    Joined: Oct 29, 2001
    Posts: 8935
        
        9

    Originally posted by Badri Prasad:
    when i gave command Javac HelloWolrd.java it could not compile the same.


    It sounds like you need to install Java. Have a look at the Fedora Java FAQ.
    [ October 03, 2007: Message edited by: Joe Ess ]
    Ulf Dittmer
    Marshal

    Joined: Mar 22, 2005
    Posts: 42374
        
      64
    Originally posted by Badri Prasad:
    when i gave command Javac HelloWolrd.java it could not compile the same.


    What does this mean? Were there any error messages? If so, which ones?


    Ping & DNS - my free Android networking tools app
    Christophe Verré
    Sheriff

    Joined: Nov 24, 2005
    Posts: 14688
        
      16

    Yes, we need the error messages first. And I'm not sure that there's a java compiler starting with a capital letter.


    [My Blog]
    All roads lead to JavaRanch
    Mark Spritzler
    ranger
    Sheriff

    Joined: Feb 05, 2001
    Posts: 17258
        
        6

    Originally posted by Christophe Verre:
    Yes, we need the error messages first. And I'm not sure that there's a java compiler starting with a capital letter.


    Well that works on Windows.

    Badri, unfortunately it won't work on Linux. In Linux everything is case-sensitive. So it does need to be exact, and in Java that Java compiler is all lower case. Actually in most cases, probably all, all commands will be all lower case on Linux, it is kind of the standard there.

    Good Luck, I admire your courage to jump into using a new OS.

    Mark


    Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
    How to Ask Questions the Smart Way FAQ
    Jesper de Jong
    Java Cowboy
    Saloon Keeper

    Joined: Aug 16, 2005
    Posts: 14279
        
      21

    Assuming you have the JDK installed on your machine, have a look at this:

    The Java Tutorial - "Hello World!" for Solaris OS and Linux

    Follow the tutorial step by step and be careful to do it exactly as shown there (i.e. don't type "Javac" when it should be "javac", for example).


    Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
    Badri Prasad
    Greenhorn

    Joined: Aug 28, 2007
    Posts: 3
    Thank you very much all you people for helping me to learn java on Linux.
    Please give me more details which will help me to learn early.
    It is very interesting to work in Linux cos its new to me and i m very
    eager to learn new things. I did not know that i have to install JDK in
    Linux, now i will install and try to execute small programs in it.

    Thank you once again all of you
    Badri
     
    jQuery in Action, 2nd edition
     
    subject: Procedure to Execute Programs in Fedora Linux