Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

compiling java on linux system

how to compile java program using gcc(or any other command).
I tried gcc -x java filename
but it didn't work
please help me out.

Comments

  • akalexi312akalexi312 Member Posts: 31
    Hello Dear,

    Have you installed gcj package for GCC.GCC is a generic front end to compiling High level languages.the core language support instllation should also be done.

    do the following things.

    1.Make sure that the gcj package is installed on your system.
    2.Create a simple hello world code in java.
    3.compile it using gcj -C filename.java

    It will generate the class file with ame filename.class

    4.Run it using gij filename ( note that do not give .class/.java extension while running from gij it will pick itself up)

    should solve your problem

    : how to compile java program using gcc(or any other command).
    : I tried gcc -x java filename
    : but it didn't work
    : please help me out.
    :



  • humanhuman Member Posts: 1
    : how to compile java program using gcc(or any other command).
    : I tried gcc -x java filename
    : but it didn't work
    : please help me out.
    :

    The same javac and java commands should work as used in jdk.
Sign In or Register to comment.