Jump to content

Recommended Posts

Posted

1. Brief history and overview:

In the late 70's Bill Joy(vice president of Sun Microsystems), wanted to design a programming language that combines the best features of C and MESA(an old programming language developed by Xerox). Joy as well attempted to re-write the UNIX operating system on C++ years later, but according to him, C++ wasn't the best choice for that specific goal. In January 1991 Bill Joy meets James Gosling, Patrick Naughton, Mike Sheradin in Aspen, Colorado. This was the beginning of the "Stealth project". The idea behind the project was to be simplified the programming of embedded devices plus their business distribution and sales on the market. C++ was considered as too sophisticated and not "flexible" enough. The software gurus behind the "Stealth project" then divided the goals and James Gosling was the person to develop the software for the new business solutions. Others took the business management and so on...Gosling named the new programming language "Oak", "thanks" to an Oak three outside his window. However, later the name "Oak" appeared as patent to other programming language. And Gosling was forced to change it. Then, surprisingly the language was named after a local coffee shop in the neighborhood of Gosling. It was perfect choice,just because the name also combined the initials of the programmers: James gosling, Arthur Van hoff, Andy bechtolsheim. After several years of tests and innovations plus millions invested, the new language appears as Java 1.0. The motto behind the release was: "Write Once, Run Everywhere".

 

 

The Java influence nowadays:

googlehits.png

 

The example above (date: 2004, April) shows the extreme popularity of Java. And not only that, but it shows that Java is the MOST POPULAR LANGUAGE. In fact although it's not mentioned in the above diagram, only C has more popularity, but assuming that on the Google searches, most software developers search for C in order to understand languages like C++ or C#, we can be sure that Java is by itself number 1 leader as popularity among the programmers nowadays. And...according to some surveys Java is also the programming language with best future. It is as well the leader when it comes to mobile phone applications, and we know the mobile phones became a top business target for companies like Google and Yahoo. At the end, it would be interesting to be mentioned that Google.com itself uses Java technologies. So, at the moment if you weren't aware of the great popularity, long history and perspective of Java, you are now maybe pretty interested to learn more of the Java language and of course, to learn how can you use this gem. Let's start.

 

 

2. Setup your computer to work with Java:

Java is FREE and multiplatform. You can run it on Windows (XP, Vista, and others), Linux, Mac OS, Solaris. However, for the current tutorial we will give a very detailed example how to install Java on Windows, and as well you will find that the installation is relatively similar on other operating systems. On Linux for example you could better use the compiled RPM package for easier installation. Then (on Linux) assuming that you use for example Redhat based distro, just open it with the "software installer" and you will have it installed in a minute. Now, lets see on Windows, what do you need:

 

2.1 Download Java:

At first sight, the tools needed to program on Java might be confusing for the newbie. But in fact programming on Java is pretty simple. All you need is the Java interpreter(which actually executes the Java programs) and some IDE that transforms the Java code into a program. In simple words, you write your Java code on the Java IDE and then later you test it thanks to the Java interpreter. Just two programs...

 

2.2 Download and install the Java platform (the interpreter):

Go here and save the dialog that appears: http://javadl.sun.com/webapps/download/AutoDL?BundleId=18713

This is the installer, which is about 15MB.

 

2.3 Running the Java installer:

Run the installer, chose "Accept":

javasetupjre1.jpg

You should see this:

javasetupjre2.jpg

After the installer finishes, you should see this:

javasetupjre3.jpg

And, this is it! You now have the Java platform installed, which does anything necessary so that you can now launch Java applications on your computer. Now that we have Java installed, lets install and the development environment, so we can create our own Java applications!

 

2.4 Download JDK + Netbeans(the Java development tools):

Go here:Download Java SE Development Kit 6u5 with NetBeans IDE 6.0.1 Bundle

1. Click on the "download" button.

2. Chose your OS. For this tutorial we use Windows;

3. Accept the Terms and conditions and click "Next".

4. On the next page your download will either start automatically if you use IE, or if you use some other browser you must save the link: jdk-1_5_0_15-nb-6_0_1-windows-ml.exe. This is located below "Required files"...

 

2.5 Install JDK + Netbeans:

Start the installer, you must see this:

javasetup1.jpg

Now you must see screen similar to this, click "Next":

javasetup2.jpg

On the next screen accept the "terms and conditions" and click "Next":

javasetup3.jpg

Chose installation directory and click "Next":

javasetup4.jpg

Select directory to install "Netbeans" and click "Next":

javasetup5.jpg

Now click "Install":

http://forum.codecall.net/images/Tutorials/apps/javasetup6.jpg

Now you must see the installation:

javasetup7.jpg

After the installation is over you should see this below...you have option to register "Netbeans" and Java, but I chose not to do, so I won't receive any ad emails...at the end click "Finish":

javasetup8.jpg

OK, so now you have the Java interpreter already installed + you have just installed the development environment so that you can now start the real programming! Now, on your Desktop you will have icon named NetBeans IDE 6.0.1. Click twice on it to open it.

 

 

3. Your first Java program:

After you open Netbeans you should see screen similar to this one below. Click on the image to see in full size.

javawelcome1-small.jpg

Now click on "File -> New project":

Click on the image to see in full size:

javawelcome2-small.jpg

Then chose "Java -> "Java application" and click "Next":

javawelcome3.jpg

Then, name your application as you wish and click "Finish":

javawelcome4.jpg

Then you should see a screen similar to this:

javawelcome5-small.jpg

Now, you can just copy the text below and paste it on a clean screen on the Neatbeans, you can even modify the code here and then paste it on the IDE:

     
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

package javaapplicationmyap;

/**
*
* @author Deus
*/
public class Main {

   /**
    * @param args the command line arguments
    */
   public static void main(String[] args) {
       // TODO code application logic here
       
       System.out.println("Hello World");
   }

}

Another closer screenshot on the "Hello world" program:

 

 

 

Now click "F6" on the keyboard OR you can chose "Run -> "Run main project":

Click on the image to see the full size:

javawelcome7-small.jpg

 

You should now see this, take a look on the bottom of the Netbeans, the execution of the program showing the string "Hello world".Click on the image to see full size:

 

javawelcome8-small.jpg

Though this program might seem "Easy" to you, it actually shows you many aspects of the OOP programming plus the Java programming itself. Lets explain the program in detail:

 

On the very top of your application you will spot the pale/gray lines:

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/ 

 

In fact these lines are NOT 100% necessary. These are the so called "comments". A comment is just line of explanation written by the programmer to explain to other programmers what the purpose of certain thing in the program is. The compiler actually neglects the comments. But of course, as any part of the programs the comments have own syntax. Note the "/*" signs. Every comment must start either with the /* sign and end with a closing *\ or IF your comment is just on a single line you can use //. These are the so called "C like" comments. Just because the C language was the first one to use such style of comments.

 

The first line "package javaapplicationmyap;" , simply shows you that everything in your application belongs to a package of classes called " javaapplicationmyap". The word "package" is a keyword, the " javaapplicationmyap" is the package of classes and the ";" is the semicolon identificator which is nothing special but a way to close the current line.

 

The second line of your first program "public class Main" defines the class.

 

The third line is the so called "method". For now you can think of the "method" as an obligatory part of any Java program. All Java programs must have the so called Main method which you use here as well...public static void main(String[] args).The word "public" means that this method can be accessed anywhere later in your program. The word "static" means that this method doesn't read any data out of that specific class, the word "void" means that nothing is expected to be returned by the method and "main" is as we mentioned the required method, stating that this is the famous and required "main" method.

 

And below is the heart of your program. Within the quotation marks you can write ANY sentence you want, just to have some fun with your first program. Such as you can write your name there or the name of your beloved one. It's up to you, but remember Java can DO a lot more than that! As we stated in the very beginning of this tutorial it is used in Google, it is even on Mars, since the Mars tutor is programmed on Java. It is on the mobile phones.

 

System.out.printIn("Hello world");

 

Credits Jordan

 

 

 

Posted

Well explained, but..

 

Eclipse is much better for coding than NetBeans.

 

thnx! ok eclipse is much better and for me ! but i just want to help ppl that hate eclipse! i know lot of ppl that cant work with eclipse :)

Posted

thnx! ok eclipse is much better and for me ! but i just want to help ppl that hate eclipse! i know lot of ppl that cant work with eclipse :)

 

Yeap, maybe.

 

NetBeans has very good GUI Builer (100x times better than Eclipse GUI Builer plugin)

 

But Eclipse code editor is 101x times better than NetBeans.

 

- in my opinion of course.

Posted

I must say I nice guide, even though I am already using netbeans and it is great. Eclipse better than netbeans ? I would not say so, I used to use netbeans and it kept hugging all memory and crashing etc. Netbeans has not crashed once for me and does not use as much resources as eclipse did. Also Netbeans has better identions and hints.

Posted

i know lot of ppl that cant work with eclipse :)

i was 1 of them but im getting used of it.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • L2 Kings    Stage 1 – The Awakening Dynasty and Moirai Level Cap: 83 Gear: Dynasty -Moirai & Weapons (Shop for Adena + Drop from mobs/instances ) Masterwork System: Available (Neolithics S required with neolithics u can do armor parts foundation aswell) Class Cloaks: Level 1 - Masterwork sets such us moirai/dynasty stats are boosted also vesper(stage 2) Olf T-Shirt: +6 (fails don’t reset) safe is +2 Dolls: Level 1 Belts: Low & Medium Enchant: Safe +3 / Max +8 / Attribution Easy in Moirai-Dynasty . Main Zones: Varka Outpost: Easy farm, Adena, EXP for new players = > 80- 100kk hour Dragon Valley: Main farm zone — , 100–120kk/hour Weapon Weakness System active (all classes can farm efficiently) Archers get vampiric auto-hits vs mobs Dragon Valley Center: Main Party Zone — boosted drops (Blessed enchants, Neolithics chance) => farm like 150-200kk per hour. Dragon Valley North: Spoil Zone (Asofe + crafting materials for MW) Primeval Isle: Safe autofarm zone (low adena for casual players) ==> 50kk per hour Forge of the Gods & Imperial Tomb: Available from Stage 1 (lower Adena reward in compare with Dragon Valley) Hellbound also avaliable from stage 1 In few words all zones opened but MAIN farm zone with boosted adena and drops is Dragon valley also has more mobs Instances: Zaken (24h Reuse) → Instead of Vespers drop Moirai , 100% chance to drop 1 of 9 dolls lvl 1, Zaken 7-Day Jewelry Raid Bosses (7 RBs): Drop Moirai Parts + Neolithic S grade instead of Vespers parts that has 7 Rb Quest give Icarus Weapons Special Feature 7rb bosses level up soul crystals aswell. Closed Areas : Monaster of SIlence, LOA, ( It wont have mobs) / Mahum Quest/Lizardmen off) Grand Epics: Unlocked on Day 4 of Stage 1 → Antharas, Valakas, Baium, AQ, etc ================================================================================= Stage 2 – Rise of Vespers Level Cap: 85 Gear: Moirai Armors (Adena GM SHOP / Craft/ Drop) Weapons: Icarus Cloaks: Level 2 Olf: +8 Dolls: Level 2 Belts: High & Top Enchant: Safe +3 / Max +8 Masterwork can be with Neolithics S84 aswell but higher so craft will be usefull aswell. 7 Raid Boss Quest Updated: Now works retail give vesper weapons 7rb Bosses Drops : Vespers Instances: Zaken : Drops to retail vespers + the dolls and the extra items that we added on stage 1 New Freya Instance: Added — drops vespers and instead of mid s84 weapons will drop vespers . Extra drops Blessed Bottle of Freya - drops 100% chance 1 of 9 dolls. Farm Areas Dragon Valley remains main farm New Zone : Lair of Antharas (mobs nerfed and added drop Noble stone so solo players can farm too) New Party Zone : LOA Circle   ============================================================================   Stage 3 – The Vorpal ERA Gear: Vorpal Unclock Cloaks: Level 3 Olf: +10 (max cap) Dolls: Level 3 Enchant: Safe +3 / Max +12 Farm Zones : Dragon Valley Center Scorpions becomes a normal solo zone (no longer party zone) Drops:   LOA & Knorik → Mid Weapons avaliable in drop New Party Zone Kariks Instances: Easy Freya Drops Mid Weapons Frintezza Release =================================================================================     Stage 4 – Elegia Era (Final Stage) Elegia Unlock Gear: Elegia Weapons: Elegia TOP s84 ( farmed via H-Freya/ Drops ) Cloaks: Level 5 Dolls: Level 3 (final bonuses) Enchant: Safe +6 / Max +16 Instances: Hard Freya → Drops Elegia Weapons + => The Instance will drop 2-3 parts for sure and also will be able to Join with 7 people . Party Zone will have also drop chances for elegia armor parts and weapons but small   Events (Hourly): Win: 50 Event Medals + 3 GCM + morewards Lose: 25 Medals + 1 GCM + more rewards Tie: 30 Medals + 2 GCM + more rewards   ================================================================================ Epic Fragments Currency Participating in Daily Bosses mass rewarding all players Participating in Instances (zaken freya frintezza etc) all players get reward ================================================================================ Adena - Main server currency (all items in gm shop require adena ) Event Medals (Festival Adena) - Event shop currency Donation coins you can buy with them dressme,cosmetics and premium account Epic Fragments you can buy with them fake epic jewels Olympiad Tokens you can buy many items from olympiad shop (Hero Coin even items that are on next stages) Olympiad Win = 1000 Tokens / Lose = 500 Tokens ================================================================================= Offline Autofarm Allows limited Offline farming requires offline autofarm ticket that you get by voting etc ================================================================================= Grand Epics have Specific Custom NPC that can spawn Epics EU/LATIN TIME ZONE ================================================================================= First Olympiad Day 19 December First Heroes 22 December ( 21 December Last day of 1st Period) After that olympiad will be weekly. ================================================================================= Item price and economy Since adena is main coin of server and NOT donation coins we will always add new items in gm shop with adena in order to burn the adena of server and not be inflation . =================================================================================        
    • Hello, I'd like to change a title color for custom npc.  I created custom NPC, cloned existing. I put unique id for it in npcname-e, npcgrp and database. I have "0" to serverSideName in db, so that it would use npcname-e, but instead it has "NoNameNPC"and no title color change.
    • Trusted Guy 100% ,  I asked him for some work and he did it right away.
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock