Notices
Results 1 to 4 of 4

Thread: Creating Executables

  1. #1 Creating Executables 
    New Member
    Join Date
    Mar 2007
    Location
    Texas
    Posts
    1
    Hi, my name is Kyle Andrews. I'm representing a Comp. Sci. programming class. We have all been discussing how to take something such as a java project or C project and making it into some kind of executable file. A file which you could click that would execute the command prompt and the java or C program. Were more interested in Java right now as we are studying java. Can anyone explain the process of making a program to where it will execute from the opening of a single file? Something to where you dont have to compile in cmd or Jcreator?


    - The Ultimate Isolated Snail
    Reply With Quote  
     

  2.  
     

  3. #2  
    Guest
    Compilers should create executable code, certainly for C C++ pascal etc as to Java It came out after I retired. I believe there lots of free 'c' compilers on the net, I guess for Java you'd have to google 'how to make java executables' or similar.


    Reply With Quote  
     

  4. #3  
    Forum Professor leohopkins's Avatar
    Join Date
    Dec 2006
    Location
    Dulwich, London, England
    Posts
    1,418
    I Would try learning C#
    As for C++ The GNU C Compiler is a nice freely downloadable programme.

    As for Java, you can download the SDK from sun microsystems.
    The hand of time rested on the half-hour mark, and all along that old front line of the English there came a whistling and a crying. The men of the first wave climbed up the parapets, in tumult, darkness, and the presence of death, and having done with all pleasant things, advanced across No Man's Land to begin the Battle of the Somme. - Poet John Masefield.

    www.leohopkins.com
    Reply With Quote  
     

  5. #4  
    Forum Freshman wonkothesane's Avatar
    Join Date
    Feb 2007
    Location
    Brisbane, Australia
    Posts
    47
    C programs compile to an executable straight off. You should be able to find a 'myProgram.exe' in the build directory of your compiler which you can just double click. However if it is a console application (no GUI) then often it will flash quickly on the screen and disappear. You have two options here
    1) Open a command prompt, change to the directory and type myProgram
    2) Create a batch file to run your program (google "batch file")

    Java is a little different. Java is compiled to bytecode which is platform independent and has to be run in a java virtual machine. So if you compile myProgram.java you'll get MyProject.class which (so long as it has a main() method) can be run by typing "java MyProject" at a command prompt. Unfortunately it is not always this easy, the java program (the virtual machine) needs to be in your PATH (environment variable) so that your OS can find it and MyProject.class must be either in the current directory or in your CLASSPATH. You could use a batch file here too. Also look into JAR files if you have multiple .class files.

    Much more detailed and easy to follow instructions can be found at http://java.sun.com/docs/books/tutorial/

    Java was my first programming language, I learned it in my spare time while at highschool and it was great 'cos it was free and the documentation is excellent.
    Fry me a kipper skipper, I'll be back for breakfast!
    Reply With Quote  
     

Bookmarks
Bookmarks
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •