I installed java in my laptop. But I couldn’t compile & run!

Asked By 0 points N/A Posted on -
qa-featured

I installed java in my laptop. But I couldn't compile& run! Please tell me how to make Setpath in my laptop? Please give me deep instructions.

SHARE
Best Answer by aika123
Best Answer
Best Answer
Answered By 0 points N/A #110741

I installed java in my laptop. But I couldn’t compile & run!

qa-featured

If you are using Windows XP or Windows 7 follow the following instructions:

  1. Right click on My Computer > Click Properties.
  2. On the System Window> Click Advance System settings> Click Advance tab > The click Environment Variables (Which is the button at the bottom).
  3. When you get to the System Variables scroll down the list until you find Path, Click Edit. Add your Java path to the path variable. Make sure not to delete what is in there. Place a “,” at the end then add the Java path.
  4. Please be reminded that you need to add both the java home path and the java homebin path.
Answered By 0 points N/A #110742

I installed java in my laptop. But I couldn’t compile & run!

qa-featured

I have a small tutorial for you.

Use this tutorial for installing Java in your laptop.
 
It may help you better to compile and run the Java program.
 
 
Step 1: Download SKD & JRE
 
First download http://www.oracle.com/technetwork/java/index.html This is for writing your own Java programs that you can compile and run, then you must download the SDK (Software Developers Kit).
 
If you just want to be able to run a Java program that has already been compiled, then you can get away with just downloading the JRE (Java Runtime Environment). Once you have decided which you need, download either the SDK or the JRE. Choose the download that is most suitable for your operating system.
 
Once you have installed your tool for your Java program then setting up the path. ( For this use step 2:).
 
Step 2: Setting up the path For window XP.
 
Right-click on 'My Computer' and selecting 'Properties'. Under the 'Advanced' tab, there is a button that allows you to set the (Environment variables). Then click on this and alter the (Path) variable so that it also contains the path to the Java executable.
 
For example, if you have installed Java in C:jdk and your path is currently set to C:WINDOWSSYSTEM32, then you would change your path to read C:WINDOWSSYSTEM32;c:jdkbin
 
When you open a new command prompt, it will reflect these changes and allow you to run Java programs by typing (Java).
 
If you have installed the SDK, then you will also be able to run "javac" to compile stuff.
 
METHOD-2 For step 2:
 
  • Open a notepad.
  • Enter this.
  • Set path= (drive-in which Java is stored):program filesjavajdk(version)bin;
  • Set classpath= (drive-in which Java is stored):program filesjavajdk(version)lib;
 
Save as "path.bat" in the folder where you have stored the Java file. 
  • Open command editor.
  • Go to drive and folder.
  • En ter "path" click ENTER.
Now you can execute YOUR program.
 
Step 3: Setting up the classpath.
 
In addition to setting up the path, you also need to tell Java where to find compiled class files at runtime.
 
You will probably want to set the classpath to include at least the current working directory (.)
 
E. g. : SET CLASSPATH=%CLASSPATH%;.
 
The classpath can also contain other directories that may contain compiled class files.
 
Note that if you are using classes that are contained inside a .jar file, you will need to specify the full path and name of this file in the classpath, rather than just the name of the directory it is contained within that's it.
 
If you use this method for installing or compiling & running of Java program you may gain success! Otherwise it is not a possibility.
 
Thanks.

Login/Register to Answer

Related Questions