• Contact Us
Friday, May 9, 2025
TheBackBuffer
  • Login
  • Home
  • Reviews
  • Security
  • Business
  • Gadgets
  • Gaming
No Result
View All Result
  • Home
  • Reviews
  • Security
  • Business
  • Gadgets
  • Gaming
No Result
View All Result
TheBackBuffer
No Result
View All Result
Home Technology

Learn Compiling and Interpreting Your First Program in Java Programing Language

by Veronika Zenz
in Technology
0
Java Programing Language
0
SHARES
141
VIEWS
Share on FacebookShare on Twitter

In this post, you will see the steps to compile and interpret your first program written in Java programing language. This Java example will set the path to start your learning as Java programmer.

STEP 1: Creating the Source Code

Open Windows Notepad (Start -> All Programs -> Accessories -> Notepad), which you will now use as work editor for its simplicity. Later, you can use a more sophisticated editor.

If you prefer to use another editor at the moment, there is no problem. It does not matter while the content is recorded as ‘plain text” (in ASCII code). Once you have the notepad opened, you we will write your first program, which will show a text “Hello Java” in the DOS console window. To clarify that for the moment, you we should not worry about understanding what you write. Here your goal now is simply to verify that you can run a program written in Java.

Next, you proceed to record your program: click on File -> Save as and you put like name Example.java. You are following a rule dictated by Java, which is the name of the file (Example.java) and the name of the program (which you have defined inside the file after writing public class, and which is also “Example”) are identical. Briefly, you must match file name and program name, both uppercase and lowercase, and the file extension should always be “.java”.

To follow an order and avoid later problems during compilation, you will have to create a folder in C: named “Exercises” and locate the program Sample.java within this folder.

STEP 2: Compilation and Program Execution

You will proceed to the compilation and interpretation of this small Java program. You will do this using the DOS console window. To display this window, proceed as follows: Start -> All Programs -> Accessories -> Command Prompt. On the console window, you will write the command “cd C: \ Exercises” and press enter. This takes you to the folder where your file is located (“Example.java”). If you have successfully entered when typing dir and press enter, you should see the file Example.java.

Now you give the instruction for the program compilation process, for what you write “javac Example.java” where “javac” is the name of the compiler (javac.exe) that will transform the program you have written in Java language to the Java Virtual Machine (bytecode) language, resulting in a new “Example.class” file to be created in this same directory. If you see an error message, check all the previous steps explained above, because it is possible that the environment variables were not created or that the file is not well located, etc. To check if the file has been created, you will write the “dir” command in the console window and will see that two files appear: Example.class (bytecode created by the compiler) and Example.java (source code created by you).

Finally, you are going to ask the interpreter to execute the program, that is, to transform the Java Virtual Machine code into machine code interpretable by your computer and execute it. For this you will write in the console window: java Example.

The result will be that the string “Hello Java” is shown to you. If you can see this text on screen, you have already developed your first program in Java.

In other operating systems the process is similar. If you have problems completing this Java example, do not worry, continue to advance with the contents available on this blog.

Java

Java is object-oriented programming language. It is the result of programming intelligence of James Gosling and his associates at Sun Microsystems in the beginning of 90s. Java programming is compiled into bytecode, which is executed by JVM. Usually, a JIT compiler is used. The language is similar to C and C++, although its object model is simpler, and was also influenced by Smalltalk and Eiffel.

JavaFX

It is a software platform allows the developers to create and run web applications with the ability to run on a variety of devices. It allows to create applications to run on desktops, web browsers and mobiles. In future, it is planned to expand JavaFX to video game consoles, Blu-Ray DVD, among others. The direct competitors of JavaFX are Flash of Adobe and Silverlight from Microsoft. OpenLaszlo was also a competitor to it, but it has been discontinued now. 

The Features

  • Creating JavaFX applications is through language JavaFX Script.
  • Desktop applications can run on Windows XP, Vista and 7, Mac OS, GNU/Linux and OpenSolaris.
  • Because of integration with JRE, its applications can run on any browser with JRE, as well as mobile phones with Java ME.

History

  • It was announced by Sun Microsystems in May 2007 at the JavaOne Worldwide Java Developer conference.
  • Version 1.0 was released on December 4, 2008.
  • Version 1.1 was released on February 12, 2009.
  • Version 1.2 was released on June 2, 2009, with full support for Linux and Solaris along with improvements in speed.

JavaFX Script

It is a scripting language developed by Sun Microsystems, which is part of the family of JavaFX technologies. JavaFX Script was originally called F3 (Form Follows Function) and was developed by Chris Oliver. In September 2005, his company, SeeBeyond Technology Corporation, was acquired by Sun and Oliver became an employee of Sun. F3 was changed to the current name and became open source in JavaOne in 2007.

F3 was an interpreted language while JavaFX Script focuses primarily as a compiled language. Compiled programs written in JavaFX Script can be run on any platform that has a newly installed Java Runtime.

The Features

  • It is a compiled scripting language, with static and declarative typing.
  • It provides automatic data hiding.
  • It supports vector graphics mode, video and Swing components through its APIs.
  • It is possible to use it as an interpreted language.

Many have this notion that JavaFX won’t survive but Oracle does not seem to be convinced with this notion and it working well for its advancements.

ShareTweetShare

Related Posts

Technology

SIP vs. VoIP: What’s the Difference and Which is Right for Your Business?

March 31, 2023
self-healing
Technology

Eliminate broken Tests and Manual Maintenance with self-healing AI

March 17, 2022
Wireless Voip Phones
Technology

Top 7 Benefits – Wireless Voip Phones For Home Or Business In 2022

December 13, 2021
Voip Phone System
Technology

SIP Trunking Is A Great Reason For Having A Voip Phone System

November 26, 2021
Technology with Depression
Technology

The Link Among Modern Media and Technology with Depression

November 3, 2021
gps tracker
Technology

How To Choose A GPS Tracker And How To Track A Vehicle With GPS

September 9, 2021
Next Post
Java Programming Language

The Overview of Java Programming Language

  • 52.2M Fans
  • 139 Followers
  • 952 Subscribers
  • 308 Followers

Recommended

Private Internet

Private Internet Access Review – Salient Features, Pros and Cons

May 8, 2020
team of scientists

Lifeasapa – Company Of The Future

February 8, 2021
5 Best NFT Marketplaces to Buy NFT Art

5 Best NFT Marketplaces to Buy NFT Art

October 3, 2021
stock traders

Important information for Singapore’s new stock traders

October 14, 2022
Clash of clans

The Tips to Do Well in Clash of Clans

April 12, 2020
Why Should You Have General Accounting Plan In The Beginning?

Why Should You Have General Accounting Plan In The Beginning?

April 4, 2020
  • Contact Us
  • Privacy Policy
  • Terms and Conditions
  • Write for Us

DISCLAIMER
TheBackBuffer is not responsible for the authenticity of the product reviews. All the reviews are for informational purpose only.
© 2020 TheBackBuffer. All right go to their respective owners

No Result
View All Result
  • Homepages
    • Home – Layout 1
    • Home – Layout 2
  • Reviews

© 2020 TheBackBuffer.com - Find best guides, tips and reviews about gaming, business, online and tech.

Welcome Back!

Login to your account below

Forgotten Password?

Create New Account!

Fill the forms bellow to register

All fields are required. Log In

Retrieve your password

Please enter your username or email address to reset your password.

Log In