How to Compile a Java Program

How to Compile a Java Program thumbnail
Compile a Java Program

There are two parts to the Java platform, the Java application programming interface, or API, and the Java virtual machine, or JVM. An API is a preset amount of code that can be called from within a program. This saves the programmer programming time. The JVM interprets the code and turns into an application to be used. This allows the code to be used on any computer, instead of just the computers that have the correct software installed.

Instructions

    • 1

      Open the text editor of your choice.

    • 2

      Write the code and create the source file.

    • 3

      Save the source file with a .java extension. If the name of your file is Example, then name it Example.java. Save the file as a txt file in the Java folder.

    • 4

      Open the command window to get to the command prompt.

    • 5

      Find the file you just created. It will be in the Java folder.

    • 6

      Compile the code. Type "javac Example.java" without the quotes. Java is case sensitive. So if you capitalized the name of the file, be sure to capitalize it here. Once compiled, you will see a new file has been created in the Java folder named Example.class.

Related Searches:
  • Photo Credit www.ilabz.net

Comments

You May Also Like

  • How to Compile Java Programming Code

    Java is a programming language that is widely used for desktop, mobile and Internet development. When writing a Java program, you first...

  • How to Install a Java Compiler

    Java is a robust computer language that you can use in web design and standalone programs. A Java compiler is needed to...

  • How to Compile a C Program Using the Gnu Compiler

    The Gnu Compiler Collection (GCC) software allows you to compile software programs written in a range of computer languages, including C, C++...

  • How to Compile C Programs Online

    Software engineers and programmers rely on compilers to help them turn their source code into fully functional programs. Compilers are programs that...

  • How to Compile PDF Files

    Portable Document Format (PDF) makes it possible to share documents between different operating systems and software programs. That's why it's a favorite...

  • How do I Fix Java Software Problems?

    Java is a computer platform developed by Sun Microsystems that allows you to play online games, chat with people over the Web,...

  • How To Write Java Programs

    Java is an object-oriented programming language originally developed and released by Sun Microsystems in the mid-1990s. Java was developed from the start...

  • How to Compile Python Code

    Since Python is an interpreted language, compilation of Python code can mean many things, including compilation to byte code or transformation to...

  • How to Edit Java Applets

    Editing Java applets involves making changes to a program's ".java" files, which provide the source code for the Java compiler. These changes...

  • How Do You Program Games?

    Learning how to program a game can be frustrating. Hundreds, if not thousands, of lines of code go into writing a game....

  • How Do I Check to See If I Have the Most Current Java Software?

    Java is a programming language used to run programs such as chat and instant message software. Finding out if you are have...

  • How to Use the New Line in Applet Window Program in Java

    The "new line" character differs with each operating system. Since Java can be run on a Linux, Unix, Mac or Microsoft operating...

  • How to Program Games With Java

    Java is a multiplatform, object-oriented programming language created by Sun Microsystems. Creating games on Java can be a great deal simpler than...

  • How to Compile Visual Basic

    Compiling your Visual Basic applications is a process that happens throughout the development phase. You compile applications when debugging, setting flags to...

  • Java & Unresolved Compilation Error

    In Java, programmers write source code to be compiled into a Java bytecode file. This file will be readable by any computer...

  • What Is Java Software?

    Java is a technology produced by Oracle (formerly Sun Microsystems) that ideally enables software makers to produce a single program that can...

  • How to Repair Your Java

    Having Java installed on your computer is an integral part of the web browsing experience. It enables you to watch videos, play...

  • How to Recompile a Kernel

    The Linux kernel is the part of the operating system that controls the hardware and system processes, and keeps everything working together....

  • How to Program 3D Games in Java

    If you want to generate 3D games, Java provides you an API, which best suits for creating 3D games. The java 3D...

Related Ads

Featured