<< Chapter < Page Chapter >> Page >

Writing, compiling, and running Java programs

Writing Java code

Fortunately, writing Java code is straightforward. You can write Java code using any plain text editor. You simply need to cause the output file to havean extension of .java.

There are a number of high-level Integrated Development Environments (IDEs) available, such as Eclipse and NetBeans, but they tend to be overkill for the relatively simple Java programs described in this module.

There are also some low-level IDEs available, such as JCreator and DrJava, which are very useful for sighted students. However, I don't know anything abouttheir level of accessibility. I normally use a free version of JCreator, mainly because it contains a color-coded editor, but that feature wouldn't be usefulfor a blind student.

So, just find an editor that you are happy with and use it to write your Java code.

Preparing to compile and run Java code

Perhaps the most complicated thing is to get your computer set up for compiling and running Java code in the first place.

The java development kit (JDK)

You will need to download and install the free Java JDK from (External Link)

I notice that Java SE 7 has been released very recently. However, my SVG graphics library was tested using Java SE 6 Update 26, and that is what I wouldrecommend. Also there is a 64-bit version, but my library has not been tested with the 64-bit version. If your operating system will accommodate it, Irecommend that you stick with the 32 bit version just in case the 64-bit version is not compatible with my library.

You will find installation instructions on the download page shown above.

JDOM version 1.1.1

You will also need to download and install a class library named JDOM 1.1.1 at (External Link)

When you do that download, you will receive a zip file that also contains some installation instructions. However, my experience is that thoseinstallation instructions are overkill, at least that is the case on a Windows machine.

All you need to do is to extract the file named jdom.jar from the zip file (look for it in the build directory in the zip file) , store it somewhere on your disk, and put it on the classpath at compile time and runtime. (I will explain the bit about the classpath a little later.)

In my case, I'm running Windows Vista Premium Home Edition and I elected to store the jdom.jar file in the following folder :

C:\Program Files (x86)\Java\jdom-1.1.1\build\jdom.jar

It doesn't really matter where you store it as long as you know how to specify that location in the classpath later.

Compiling and running Java code

There are a variety of ways to compile and run Java code. The way that I will describe here is the most basic and, in my opinion, the most reliable. These instructionsapply to a Windows operating system. If you are using a different operating system, you will need to translate the instructions to your operating system.

Write your Java program

Begin by writing your Java program into a text file with an extension of .java. Save it in a folder somewhere on your disk. Make sure that you adhere tothe earlier instructions regarding the name of the class and the name of the file, and remember that everything is case sensitive.

Questions & Answers

how to study physic and understand
Ewa Reply
what is conservative force with examples
Moses
what is work
Fredrick Reply
the transfer of energy by a force that causes an object to be displaced; the product of the component of the force in the direction of the displacement and the magnitude of the displacement
AI-Robot
why is it from light to gravity
Esther Reply
difference between model and theory
Esther
Is the ship moving at a constant velocity?
Kamogelo Reply
The full note of modern physics
aluet Reply
introduction to applications of nuclear physics
aluet Reply
the explanation is not in full details
Moses Reply
I need more explanation or all about kinematics
Moses
yes
zephaniah
I need more explanation or all about nuclear physics
aluet
Show that the equal masses particles emarge from collision at right angle by making explicit used of fact that momentum is a vector quantity
Muhammad Reply
yh
Isaac
A wave is described by the function D(x,t)=(1.6cm) sin[(1.2cm^-1(x+6.8cm/st] what are:a.Amplitude b. wavelength c. wave number d. frequency e. period f. velocity of speed.
Majok Reply
what is frontier of physics
Somto Reply
A body is projected upward at an angle 45° 18minutes with the horizontal with an initial speed of 40km per second. In hoe many seconds will the body reach the ground then how far from the point of projection will it strike. At what angle will the horizontal will strike
Gufraan Reply
Suppose hydrogen and oxygen are diffusing through air. A small amount of each is released simultaneously. How much time passes before the hydrogen is 1.00 s ahead of the oxygen? Such differences in arrival times are used as an analytical tool in gas chromatography.
Ezekiel Reply
please explain
Samuel
what's the definition of physics
Mobolaji Reply
what is physics
Nangun Reply
the science concerned with describing the interactions of energy, matter, space, and time; it is especially interested in what fundamental mechanisms underlie every phenomenon
AI-Robot
what is isotopes
Nangun Reply
nuclei having the same Z and different N s
AI-Robot
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Accessible physics concepts for blind students. OpenStax CNX. Oct 02, 2015 Download for free at https://legacy.cnx.org/content/col11294/1.36
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Accessible physics concepts for blind students' conversation and receive update notifications?

Ask