[Tut] How to edit your java files + Compiling

Results 1 to 9 of 9
  1. #1
    right + down + X GhostSnyper is offline
    MemberRank
    May 2006 Join Date
    AZ, USALocation
    2,818Posts

    [Tut] How to edit your java files + Compiling

    Well, some people may need this, since we are not all computer savvy. Ill be showing you all some of the tools to edit and compile, so that way you can make your java editing easier, and more efficient.

    1. Programs with Java Support
    Textpad
    Netbeans SE
    Notepad++

    2. Editing using the following programs
    Note: I do not have all these installed as of yet, however I will add content for them as I use them. I also am going to use a generic source for these tutorials; my server source is still in the works and is to be kept a secret ;)

    Textpad: This is the program I personally use for editing my server source files. I like it because it is simple, has syntax highlighting, and is not taxing on the computer(Low ram usage). it also has tabbed files, so one window can have many windows open. another bonus is that it is expandable to allow more file formats, and comes installed with several java hot keys.

    From the picture below, you can see that it has a lot of compatibility with source files


    It also syntax highlights all the supported file types out of the box


    It is java friendly, with built in java macros


    And finally, it not only has the tools, it also runs the compile in the window! I even had a runserver.bat tied to it, and had my server running through textpad


    Compiling using the Command Shell(DOS)
    In this section, you are going to learn how to compile using good old DOS. I used to do this back when I was editing using notepad in my java class at school(Weren't allowed to use anything else so we didn't get dependent on a specific program).

    For this tutorial, I shall assume that you have your Java System variables set up; if you don't know what I mean, you probably didn't do it...Follow my tutorial Here. The path of the files that I'm compiling are located in
    Code:
    D:\RuneScape Private Servers\GangScape v5
    First, we need to open the compiler. you can either go to Start > Run and type cmd, or just hit winkey+r then type cmd


    Next, we need to get to the folder of where our java files are at in the cmd window we type
    Code:
    D:
    once it gets to the drive path, then we can type the rest of the path for the file using the change directory command
    Code:
    cd runescape private servers\gangscape v5\
    and it should look like so


    Once we are in the directory, we can now compile our source files. we are going to use the following command to compile
    Code:
    javac -g *.java
    now if the compile was successful, the screen should say this

    if you happen to get an error, it'll look something like this

    Simple enough, eh? now you don't have to cd to the same path over and over, it stays there and you can compile as many times as you need. also, if you don't like screen clutter, you can type
    Code:
    cls
    to clear the command prompt screen.

    Compiling using a batch file
    We all have these in our java folders, but there is some confusion about these...So let's get on with it...

    Now we are going to create this batch file from scratch. You can use any text editor, and I'm using textpad(Explained above, so don't ask...)

    open a new file. Now before we do anything, let us save it as a bat. Hit file, then save as; find the directory you want it at. Now make sure file type is on all, and save it as a .bat. in this instance, I named mine Compile and Run.bat


    Now the fun part... Now editing it is simple enough but we can do some neat things here. I'll show you these all later...
    First of all, we want to turn the directory line off...it's ugly, and we don't need it. our first line is going to be
    Code:
    @echo off
    . now since this is a really simplistic batch I don't need a mess of screen shots... Next we shall include our title... my line looks like
    Code:
    title Compile and Run
    but your's can say anything you want. Now since this is a compile and run, I am going to both compile and run, I shall have both commands here. your next lines should look like so
    Code:
    javac -g *.java
    java -Xmx1024m server 
    pause
    the -Xmx1024m is a code that over rides the default memory allocation, and tells it to store 2 gigs instead...make sure that it takes no more than 75% of your ram to ensure....stability...
    now the pause keeps it from closing, in the instance that the server crashes...your end result should look like this, and this is how it looks like when run



    ATM that's all I got installed...I'll get to notepad++ and netbeans soon.
    Last edited by GhostSnyper; 07-06-08 at 07:03 PM. Reason: Added command prompt compiling


  2. #2
    Member Musiqluver is offline
    MemberRank
    Jun 2007 Join Date
    Maybeh Behind you Maybeh In China Who KnowsLocation
    72Posts

    Re: [Tutorial] How to edit your java files + Compiling

    Nice Tutorial! 9/10 But I think this is basic and it will help the new comers :)

  3. #3
    right + down + X GhostSnyper is offline
    MemberRank
    May 2006 Join Date
    AZ, USALocation
    2,818Posts

    Re: [Tutorial] How to edit your java files + Compiling

    Thanks. It is aimed towards the newbies. also it's a great way to get the word out on textpad; great program and it is very java-oriented

  4. #4
    Member Musiqluver is offline
    MemberRank
    Jun 2007 Join Date
    Maybeh Behind you Maybeh In China Who KnowsLocation
    72Posts

    Re: [Tutorial] How to edit your java files + Compiling

    [url=www.textpad.com]Textpad[/irl]
    ghost you have an error. Easy to fix :P
    [url=www.textpad.com]Textpad[/ url]

  5. #5
    right + down + X GhostSnyper is offline
    MemberRank
    May 2006 Join Date
    AZ, USALocation
    2,818Posts

    Re: [Tutorial] How to edit your java files + Compiling

    Good call! Thanks, didn't see that there :) link fixed. I was talking about .hack// and I guess I typed what I talked about

  6. #6
    Account Upgraded | Title Enabled! georgegeorge is offline
    MemberRank
    Oct 2005 Join Date
    Israel, Tel-AviLocation
    1,079Posts

    Re: [Tutorial] How to edit your java files + Compiling

    nice

  7. #7
    There's no RL just AFK -fedexer- is offline
    MemberRank
    May 2006 Join Date
    ScotlandLocation
    1,632Posts

    Re: [Tutorial] How to edit your java files + Compiling

    Quote Originally Posted by ghostsnyper View Post
    Good call! Thanks, didn't see that there :) link fixed. I was talking about .hack// and I guess I typed what I talked about
    OR... this was an attempt to hack our javas ^^

    Nice tutorial mate, i never knew textpad had a build in java compiler, i personally prefer eclipse.

  8. #8
    Proficient Member rolls is offline
    MemberRank
    Apr 2008 Join Date
    In a box with a computerLocation
    164Posts

    Re: [Tutorial] How to edit your java files + Compiling

    thx

  9. #9
    The World Is Yours PixelPro is offline
    MemberRank
    Jun 2007 Join Date
    UKLocation
    3,252Posts

    Re: [Tut] How to edit your java files + Compiling

    Nice tutorial, could help some people. (Like me = I'm sort of new to Runescape servers but not new to Runescape itself.) 8/10. I was just looking for something like this, thanks. And, its also good to post screenshots so people could get a better understanding. =]



Advertisement