Getting started (FROM THE VERY BEGINNING)

Discussion in 'Plugin Development' started by GhandPivot, Mar 13, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    GhandPivot

    Hello people!
    I have some experiences from flash and game maker and I would like to try to code some in java aswell. Although I have seriously no idea where to being. How do I even open a java file so that I can edit it? Anyone who can give me a step-by-step guide of how to get to the script-handler (if there's one?) or link a guide? NOTE: I'm not asking for help with learning the basic coding, just how to start, how to get to the "text-document" which I can mess with!

    Thanks for explaining :)

    Ps: I may very well be completely out of bounds, I have no idea how java is constructed :D
    If that's so, please correct me and tell me how the whole thing works!
    [MERGETIME="1300017352"][/MERGETIME]
    UPDATE: Do you use the notepad as "script-handler" when coding in Java :confused:?
     
  2. Offline

    contex

    Try NetBeans or Eclipse Java :)
     
  3. Offline

    nickguletskii

    First of all, Java isn't a scripting language. What you will need is an IDE (Eclipse is the best by far), the JDK (I use OpenJDK, just because it is open), and a good tutorial (I suggest the official Oracle documentation).
     
  4. Offline

    Sammy

    @GhandPivot Sorry to be a pain but I must say this:

    Anyone that wants to code must have persistence in him, must try try and try, making this kind of post makes me mad...
    1) There are so many post just like this on the forum.
    2) Bukkit's wiki has a tutorial.
    3) There are videos tutorials on this.
    USE THE SEARCH FIRST !!!
     
  5. Offline

    GhandPivot

    Trust me, I've been trying! Although that I've been looking around on the wiki for a while I still haven't find anything about how to start from the very very beginning, which some kind people told me above :)
    [MERGETIME="1300030262"][/MERGETIME]
    Thank you :D
    [MERGETIME="1300030286"][/MERGETIME]
    Thank you for being that very specific with the information, very helpful :)
    EDIT: Sorry, but there seem to be quite a lot of different downloads on OpenJDK. Ubuntu, Fedora, Red Hat, openSUSE, Debian etc. Would you bother to help me out a little :) ?
     
  6. Offline

    Sammy

  7. Offline

    nickguletskii

    Oh wait, it only has Linux binaries... Then use this:
    https://cds.sun.com/is-bin/INTERSHO...ProductRef=jdk-6u24-oth-JPR@CDS-CDS_Developer
     
  8. Offline

    GhandPivot

    Sweet :) I'm actually ready to start youtube searchin' :D
    Thanks!
    Btw, java uses SQL, right? I know a few about this language but it seems quite easy:p
    [MERGETIME="1300047376"][/MERGETIME]
    Thanks for sharing the links, might come handy :)
    I think I searched in the wrong place, I was looking around in the development forum, which clearly was the wrong place to look!
     
  9. Offline

    Sammy

    Sorry if I was to harsh ;)
    But I see to many people that come here thinking that we're going to make the plugin for them since the start...
     
  10. Offline

    Bubby4j

    Java only uses SQL if you are connecting to a database.
     
  11. Offline

    Daniel Heppner

    I recommend NetBeans, it's far better. (silly people).
    It auto-formats your code and even automagically compiles a .jar file for you. On netbeans just save the file to make it, on Eclipse you have to go up and export it manually.
     
  12. Offline

    eltorqiro

    One thing I would add to this is that you need to take a lot of things you read about getting started are very out of date or have errors in them, especially to do with coding, and especially on the wiki. For example, if you follow the wiki articles posted above, you simply won't have a plugin that even compiles, let alone does anything.

    As an IDE choice, if you are new to Java development and are really only using/learning it for bukkit, you would be better off choosing Eclipse because most developers on here use it due to the recommendation in the wiki articles. Thus you'll have a wider audience on these forums for any IDE related questions.

    @Sammy It isn't really fair to quote those sources, because they are all out of date and will *not* produce a working plugin, even if followed to the letter.
     
  13. Offline

    Sammy

    @eltorqiro I really don't think that the way to setup your workspace and IDE changed...
     
  14. Offline

    eltorqiro

    Here is what I did to get set up.

    1> Download JDK from http://www.oracle.com/technetwork/java/javase/downloads/index.html

    2> Get Eclipse from http://www.eclipse.org/downloads/
    I used http://www.eclipse.org/downloads/do.../SR2/eclipse-java-helios-SR2-win32-x86_64.zip

    3> Make Eclipse use the JDK by adding these two lines to your eclipse.ini
    -vm
    C:\Program Files\Java\jdk1.6.0_24\bin

    (or wherever you installed the JDK, that's the default for 64bit JDK on 64bit Win7)

    4> Get the maven for eclipse plugin from within Eclipse, Help -> install new software -> type in http://m2eclipse.sonatype.org/sites/m2e

    5> Select JDK as an installed & default JRE within Eclipse from Window -> Preferences -> Java -> Installed JREs

    6> Get the git for eclipse plugin, Help -> install new software -> Helios / Collaboration / Eclipse Egit

    That gets Eclipse set up and ready for actually doing some work, and from there you can add the bukkit git repository so you can build your plugin against it.

    7> File -> Import -> Git \ Projects from Git -> Clone... -> URI = https://github.com/Bukkit/Bukkit.git -> Next -> (tick Master only) -> Directory = wherever you want to put it

    8> File -> Import -> Maven -> Existing maven project -> Root Directory = whatever you chose in Step 7 for the Directory -> Finish

    9> Build bukkit by right-clicking the project on the left and -> Run As -> maven clean, then doing the same thing but choosing maven install

    That gets you to the point of having the bukkit code on your machine, a git repository set up for fetching changes to the bukkit code, and the bukkit artifact built off that code. Beyond that you are now ready to start coding an actual plugin, and for that I'd recommend going into the Plugin Releases forum and grabbing someone else's code as then you know it actually works :)


    @Sammy Probably not, but you also linked specifically to the Programming A Plugin wiki article, and the Getting Started thread, both of which are completely out of date and will just cause confusion. It is also only going to lead to more posts from him (that will undoubtedly annoy you) when none of that info works. At least link him relevant and up-to-date articles (if there are any).
     
    Pandarr likes this.
  15. Offline

    Sammy

    @eltorqiro
    Grab this tutorial that you just made and start a thread [​IMG]
    What annoys me is people who don't search the forums, the ones that want a personalized answer for everything...
     
Thread Status:
Not open for further replies.

Share This Page