Posts

Showing posts with the label JAVA

Running a JAVA applet program

This is to test if JAVA is installed properly. A Java applet program which is compiled without using and IDE. The procedure is as follows Applet Hello world Running it from the console without any IDE A. Creating a class extending the applet class 1. open your favourite editor and type in the following code public class HWApplet extends java.applet.Applet {     public void paint(java.awt.Graphics g)     {         g.drawString("greetings",50,50);     } } 2. Save the file as HWApplet.java B. Creating a HTML file to run the applet 1. Open your editor and type in the following code <APPLET code="HWApplet.class" width=350 height=200></APPLET> 2. Save it as HW.html in the same directory as the HWApplet.java file C. Compile the Java program 1. you can compile the Java program by going into the folder containing the file and using Javac javac HWApplet.java D. Running the Applet 1...

Installation of Netbeans IDE in Linux

Installation of NETBEANS IDE in linux 1. Download netbeans from http://netbeans.org/downloads/ (choose the version depending on your system) 2. After download is complete, cd to the download location you will find a netbeans-ver.sh script 3. open terminal, cd to the location of the .sh file and type chmod u+x netbeans-ver.sh (changes the execute permissions) 4. Then type "./netbeans-ver.sh" to execute the shell script 5. The installer pops up and you can specify the destination for installtion. (say ~/netbeans-ver) 6. Agree to terms and conditions and complete the installation 7. After installation is done open ~/.bashrc file in your favourite editor (.bashrc is a hidden file) 8. Add the follwing lines to the end of the file  export PATH=$PATH:/location-to-netbeans/lib (for example in this case where the location is ~/netbeans-ver type export PATH=$PATH:~/netbeans-ver/lib) 9. close the terminal and open it again and type "netbeans" to open the IDE. 10...

Installation of Sun JAVA 6 in Ubuntu 11.04

Hello, There are a number of websites that explain how to install Java 6 on your Ubuntu machine. Here I have recorded the installation of JAVA in a brand new Ubuntu 11.04 machine. You need to install JDK and JRE to get Java up and running in your system. Installing JAVA 6 in ubuntu 11.04 Natty 1. Installing JRE - Java Runtime Environment sudo add-apt-repository ppa:ferramroberto/java sudo apt-get update sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts 2. Installing JDK sudo apt-get install sun-java6-jdk Testing if installation is fine 1. open terminal 2. type "javac -version" it displays the version of java compiler if installation is fine http://www.ubuntugeek.com/install-jre-in-ubuntu-11-04-natty-using-ppa.html