Thursday 30 May 2013

how to enable java console in mac

Mac OS X comes with a pre-installed Java Runtime environment (JRE). There are different versions of Java and Mac users using different OS such as Leopard, Lion. Mac users may have different JRE versions installed on their Mac's.
Mac users need to know that though JRE comes pre-installed on their machines, the Java Console is disabled by default. It means you are likely to get JRE related errors when you try to run an application on Mac that needs Java Runtime environment. There is a simple solution to this problem, activate the Java Console and enable Javascript on your Mac. Let's take a look at steps to enable viewing of Java Console in a Mac.
Steps to enable Java Console on Mac:
Close all Internet browsers before proceeding. This step is necessary because you will be required to restart your Internet browsers again after activating Java Console on your Mac.
  • Step 1: Navigate to Application folders. You can use the Finder's Go Menu to navigate to the Application folder. The top-right corner of the Finder's goes Menu lists Application option. Clicking on "Application" reveals the application folder.

  • Step 2: Navigate to Utiliities-> Java in Applications folder.

  • Step 3: Click on the item labeled as "Java preferences" icon in Java folder.

  • Step 3: Click on "Advanced" tab located on the top of the window.

  • Step 4: Locate the "Show Console" in Java Console section in Java Prefrences window.

  • Step 5: Select radio button "Show Console" in the Java Preferences window.
After you have enabled the view of Java Console in Mac OS, you need to enable Javascript in order to run Java Virtual Machine on your Mac. You can use any browser such as Safari, Internet Explorer, or Mozilla Firefox installed on your Mac to enable Javascipt.
Steps to activate Javascript in Safari:
  • Launch Safari browser by click on the application icon in the dock
  • Go to "Menu" option located on the top right corner of the application
  • Select "Preferences" from the menu
  • In preferences window, click on "Security" tab.
  • Locate the option "Enable Javascript" and check the box adjacent to the option.
  • Click on "Save" in the Preferences window to save the settings and exit the Preferences window.
Steps to activate Javascript in Firefox:
  • Launch Firefox browser by clicking on the application icon in the dock
  • Go to "Menu" option located on the top right corner of the application
  • Select "Preferences" from the menu
  • In preferences window, click on "Content" tab.
  • Locate the option "Enable Javascript" and check the box adjacent to the option.
  • Click on "Save" in the preferences window to save the settings and exit the preferences window
Steps to activate Javascript in Internet Explorer 5 and above:
  • Launch Internet Explorer by clicking on the application icon in the dock
  • Go to "Tools " menu option located on the tool bar
  • Select "Internet options" from the menu
  • In Internet Options window, click on "Security" tab.
  • Locate the "Custom level" button and click on it.
  • In Security Settings dialog box, enable "Active Scripting" under Scripting category.
  • Click on "Ok" to quit the window.
  • Click Refresh to apply the changes.

Wednesday 15 May 2013

Java Programming, An Introduction


Java is a programming language developed by Sun in 1995. It is designed to be platform independent. This means that the same program can run regardless of whether you use Windows, MacOS, Linux or a cell phone. To do this there must be a Java interpreter installed on the system where the program should run.
Java allows you to write programs without having to go out and buy something. It only requires some time and patience.
Java can be used for making interactive parts of web sites. It is known as applets. This may be small games or useful tools. Java should not be confused with JavaScript, which can also be used for websites. These are two different things.
Java is OOP. Object Oriented Programming. It's a slightly different way of thinking than the "old fashioned" programming language. There could for example have two variables X and Y without having defined any relation between them. In OOP, it could be that you have the object "point" which has x and y as variables that determine point coordinates. It's a little hard to explain very briefly. You probably should try it to understand it.
You can get started with programming Java applications without buying any software. Just as HTML can be written in a plain text editor like notepad in Windows, you can also write Java applications. It just requires that you change the suffix on the file extension from Txt to Java.
/ / Comment
public class HelloWorld
{ public static void main (String [] args)
{ System.out.println ("Hello World!"); } }
The above small program is probably one of the simplest you can make. It prints out the text "Hello World".
To be able to run your Java program, you need to change it to byte-code. The tool to do this is called JDK, Java Development Kit. The latest version is called JDK 6 Update 23. It can be downloaded free from oracle.com
Now, it is not enough with notepad and compiler. It is also necessary to have a book on Java. There are many sources available on the net.
It is a matter of taste whether you liked the somewhat primitive method of writing in notepad or whether you'd rather use a large package with many utilities and guides. But if you want to learn how to program from scratch, I would recommend this simple tool. It is perhaps inconvenient to write all the code, but you learn something by doing it.
Java games are used on many pages and are usually developed by professional programmers. It is also be possible to make a simple game if you are a hobby programmer. When I taught myself Java for a few years ago I made a little Java game to gain some practice in programming.