Environment Setup


We set up the Java Programming environment online so that you can assemble and carry out all the accessible instances online. It provides you self-confidence in what you are studying and authorizes you to check the programs with many non-identical options. Feel liberty to change and enhance any instance and carry out it online.

Below is the example of code box in the given example, check out

public class MyFirstJavaProgram {
   public static void main(String []args) {
      System.out.println("Hello World");

Most of the examples given during this tutorial are full-fledged, So just make use of it and luxuriate in your learning.

Local Environment Setup

If you would like to line up your own environment for the Java programming language, then this section guides you through the entire process. Please follow the steps given below to line up your Java environment.

Java SE is out there for download for free of charge. To download click here, please download a version compatible together with your OS

Follow the instructions to download Java, and run the .exe to put in Java on your machine. Once you've installed Java on your machine, you'd have to set environment variables to point to correct installation directories.

Setting Up the path for Windows 2000/XP

Assuming you've got installed Java in c:\Program Files\java\jdk directory −

  • Right-click on 'My Computer' and choose 'Properties.
  • Click on the 'Environment variables' option present under the 'Advanced tab.
  • Now, edit the 'Path' variable and add the trail to the Java executable directory at the top of it. For instance, if the patch is currently set to C:\Windows\System32, then edit it the subsequent way C:\Windows\System32;c:\Program Files\java\jdk\bin.

Setting Up the path for Windows 95/98/ME

  • Assuming you've got installed Java in c:\Program Files\java\jdk directory
  • Edit the 'C:\autoexec.bat' file and add the subsequent line at the top

SET PATH=%PATH%;C:\Program Files\java\jdk\bin

Setting Up the Path for Linux, UNIX, Solaris, FreeBSD

Environment variable PATH should be set to point to where the Java binaries are installed. ask your shell documentation if you've got trouble doing this.

For example, if you employ bash as your shell, then you'd add the subsequent line at the top of your .bashrc −

  • export PATH=/path/to/java:$PATH'

Popular Java Editors

To write Java programs, you would like a text editor. There are even more sophisticated IDEs available within the market. the foremost popular ones are briefly described below −

  • Notepad − On the Windows tool, you'll use any simple text editor like Notepad (recommended for this tutorial) or WordPad. Notepad++ is additionally a free text editor which enhances facilities.
  • Netbeans − it's a Java IDE that's open-source and free which may be downloaded from https://www.netbeans.org/index.html.
  • Eclipse − it's also a Java IDE developed by the Eclipse open-source community and may be downloaded from https://www.eclipse.org/.

IDE or Integrated Development Environment provides all common tools and facilities to assist in programming, like ASCII text file editor, build tools and debuggers, etc.