[Guide] How to compile source

Page 1 of 3 123 LastLast
Results 1 to 15 of 43
  1. #1
    Account Upgraded | Title Enabled! Aznkidd235 is offline
    MemberRank
    Apr 2007 Join Date
    518Posts

    [Guide] How to compile source

    create a .bat file and name it anything you want i created my file at "D:\BDEmu\Server\src\main\java" you must create this file at the root folder of the source files so it can compile them.

    you must also change the paths of the code below to point to where your libs path are.

    also copy gameserver.jar and make a duplicate but name it gameserver2.jar

    inside the text file add this code:
    Code:
     
       @rem Set local scope for the variables with windows NT shell
    if "%OS%"=="Windows_NT" setlocal
    
    set DIRNAME=%~dp0
    if "%DIRNAME%" == "" set DIRNAME=.
    set APP_BASE_NAME=%~n0
    set APP_HOME="D:\BDEmu\Server\gameserver\bin"
    
    set CLASSPATH=D:\BDEmu\Server\gameserver\lib\gameserver2.jar;D:\BDEmu\Server\gameserver\lib\tools.jar;D:\BDEmu\Server\gameserver\lib\bcprov-ext-jdk16-1.46.jar;D:\BDEmu\Server\gameserver\lib\thymeleaf-3.0.0.RELEASE.jar;D:\BDEmu\Server\gameserver\lib\nekohtml-1.9.22.jar;D:\BDEmu\Server\gameserver\lib\spark-core-2.6.0.jar;D:\BDEmu\Server\gameserver\lib\commons-codec-1.10.jar;D:\BDEmu\Server\gameserver\lib\lzma-java-1.3.jar;D:\BDEmu\Server\gameserver\lib\JDA-3.0.0_194.jar;D:\BDEmu\Server\gameserver\lib\lombok-1.16.16.jar;D:\BDEmu\Server\gameserver\lib\commons.jar;D:\BDEmu\Server\gameserver\lib\ognl-3.1.3.jar;D:\BDEmu\Server\gameserver\lib\javassist-3.20.0-GA.jar;D:\BDEmu\Server\gameserver\lib\attoparser-2.0.0.RELEASE.jar;D:\BDEmu\Server\gameserver\lib\unbescape-1.1.3.RELEASE.jar;D:\BDEmu\Server\gameserver\lib\slf4j-api-1.7.21.jar;D:\BDEmu\Server\gameserver\lib\xercesImpl-2.11.0.jar;D:\BDEmu\Server\gameserver\lib\jetty-server-9.3.14.v20161028.jar;D:\BDEmu\Server\gameserver\lib\jetty-webapp-9.3.14.v20161028.jar;D:\BDEmu\Server\gameserver\lib\websocket-server-9.3.14.v20161028.jar;D:\BDEmu\Server\gameserver\lib\websocket-servlet-9.4.4.v20170414.jar;D:\BDEmu\Server\gameserver\lib\commons-lang3-3.5.jar;D:\BDEmu\Server\gameserver\lib\commons-collections4-4.1.jar;D:\BDEmu\Server\gameserver\lib\json-20140107.jar;D:\BDEmu\Server\gameserver\lib\trove4j-3.0.3.jar;D:\BDEmu\Server\gameserver\lib\jna-4.2.2.jar;D:\BDEmu\Server\gameserver\lib\nv-websocket-client-2.0.jar;D:\BDEmu\Server\gameserver\lib\unirest-java-1.4.9.jar;D:\BDEmu\Server\gameserver\lib\sqlite-jdbc-3.16.1.jar;D:\BDEmu\Server\gameserver\lib\ws-commons-util-1.0.2.jar;D:\BDEmu\Server\gameserver\lib\commons-io-2.5.jar;D:\BDEmu\Server\gameserver\lib\commons-httpclient-3.1.jar;D:\BDEmu\Server\gameserver\lib\log4j-core-2.6.2.jar;D:\BDEmu\Server\gameserver\lib\log4j-slf4j-impl-2.6.2.jar;D:\BDEmu\Server\gameserver\lib\disruptor-3.3.6.jar;D:\BDEmu\Server\gameserver\lib\slf4j-ext-1.7.25.jar;D:\BDEmu\Server\gameserver\lib\gson-2.8.0.jar;D:\BDEmu\Server\gameserver\lib\mongo-java-driver-2.14.3.jar;D:\BDEmu\Server\gameserver\lib\ecj-4.6.1.jar;D:\BDEmu\Server\gameserver\lib\stringer-annotations-1.0.3.jar;D:\BDEmu\Server\gameserver\lib\jackson-core-2.9.0.pr3.jar;D:\BDEmu\Server\gameserver\lib\jackson-annotations-2.9.0.pr3.jar;D:\BDEmu\Server\gameserver\lib\jackson-databind-2.9.0.pr3.jar;D:\BDEmu\Server\gameserver\lib\classindex-3.4.jar;D:\BDEmu\Server\gameserver\lib\xml-apis-1.4.01.jar;D:\BDEmu\Server\gameserver\lib\javax.servlet-api-3.1.0.jar;D:\BDEmu\Server\gameserver\lib\jetty-http-9.3.14.v20161028.jar;D:\BDEmu\Server\gameserver\lib\jetty-io-9.3.14.v20161028.jar;D:\BDEmu\Server\gameserver\lib\jetty-xml-9.3.14.v20161028.jar;D:\BDEmu\Server\gameserver\lib\jetty-servlet-9.3.14.v20161028.jar;D:\BDEmu\Server\gameserver\lib\websocket-common-9.3.14.v20161028.jar;D:\BDEmu\Server\gameserver\lib\websocket-client-9.3.14.v20161028.jar;D:\BDEmu\Server\gameserver\lib\httpclient-4.5.2.jar;D:\BDEmu\Server\gameserver\lib\httpasyncclient-4.1.2.jar;D:\BDEmu\Server\gameserver\lib\httpmime-4.5.2.jar;D:\BDEmu\Server\gameserver\lib\junit-4.12.jar;D:\BDEmu\Server\gameserver\lib\log4j-api-2.6.2.jar;D:\BDEmu\Server\gameserver\lib\jetty-util-9.3.14.v20161028.jar;D:\BDEmu\Server\gameserver\lib\jetty-security-9.3.14.v20161028.jar;D:\BDEmu\Server\gameserver\lib\httpcore-4.4.5.jar;D:\BDEmu\Server\gameserver\lib\httpcore-nio-4.4.5.jar;D:\BDEmu\Server\gameserver\lib\hamcrest-core-1.3.jar;D:\BDEmu\Server\gameserver\lib\commons-logging-1.2.jar;D:\BDEmu\Server\gameserver\lib\websocket-api-9.4.4.v20170414.jar;D:\BDEmu\Server\gameserver\lib\netty-all-4.1.12.Final.jar;D:\BDEmu\Server\gameserver\lib\commons-math3-3.6.1.jar >> log.txt
    
    for /r %%a in (*.java) do ( "C:\Program Files\Java\jdk1.8.0_112\bin\javac" "%%a" )

    compile.png

    make sure the javac part of the code points to where you installed your javac.


    once you have created this file just run it to compile everything in your source folder to .class file everytime you modify the source and want to update the server files you must compile to .class first before you can import to Eclipse Neon to create a .jar file

    Download Eclipse Neon or the other available version from:
    https://eclipse.org/

    install and import source into Eclipse and export to .jar files must be compiled to .class first before you export or else it will not run.

    compile2.png
    Last edited by Aznkidd235; 07-01-18 at 04:57 PM.


  2. #2
    Account Upgraded | Title Enabled! Via Nais is offline
    MemberRank
    Jun 2014 Join Date
    276Posts

    Re: [Guide] How to compile source

    *total noob*

    What is this for ? When would we have to use such a script ?

    Thanks !

  3. #3
    Account Upgraded | Title Enabled! Aznkidd235 is offline
    MemberRank
    Apr 2007 Join Date
    518Posts

    Re: [Guide] How to compile source

    Quote Originally Posted by Via Nais View Post
    *total noob*

    What is this for ? When would we have to use such a script ?

    Thanks !
    The current server files is an emulator which has bugs and isn't perfect, but included with the files is the source code for the server files so we can modify and change existing code for the better and in order to compile the files once the change has been made you would have to follow the steps in this guide.

  4. #4
    Account Upgraded | Title Enabled! Via Nais is offline
    MemberRank
    Jun 2014 Join Date
    276Posts

    Re: [Guide] How to compile source

    Roger that, thanks.

  5. #5
    (⌐■_■) NourAyman is offline
    MemberRank
    Feb 2012 Join Date
    Behind you :PLocation
    683Posts

    Re: [Guide] How to compile source

    i recommend using Intellij IDEA to be aware of implementations and view a clearer code

  6. #6
    Account Upgraded | Title Enabled! Elssair is offline
    MemberRank
    Dec 2013 Join Date
    334Posts

    Re: [Guide] How to compile source

    Ty for help @Aznkidd235

    I've this error when I'm trying to compile, is that normal?

    https://imgur.com/a/Gr6dA

  7. #7
    Account Upgraded | Title Enabled! Aznkidd235 is offline
    MemberRank
    Apr 2007 Join Date
    518Posts

    Re: [Guide] How to compile source

    Quote Originally Posted by Elssair View Post
    Ty for help @Aznkidd235

    I've this error when I'm trying to compile, is that normal?

    https://imgur.com/a/Gr6dA
    most likely the .bat can't find the libs double check the paths, then open mainserver.java check where startup and gameserverRMI and the other .java dependencies are located. in order to compile correctly all the files needs to be in the correct paths.

  8. #8
    Account Upgraded | Title Enabled! Elssair is offline
    MemberRank
    Dec 2013 Join Date
    334Posts

    Re: [Guide] How to compile source

    @Aznkidd235

    Fixed!! The problem is that I haven't got gameserver2.jar
    Last edited by Elssair; 06-01-18 at 06:37 PM.

  9. #9
    Enthusiast FredZem is offline
    MemberRank
    Jun 2012 Join Date
    33Posts

    Re: [Guide] How to compile source

    and the source code of Loginserver?

  10. #10
    Account Upgraded | Title Enabled! Aznkidd235 is offline
    MemberRank
    Apr 2007 Join Date
    518Posts

    Re: [Guide] How to compile source

    Quote Originally Posted by FredZem View Post
    and the source code of Loginserver?
    use CFR decompiler to decompile the source of login.jar located in the loginserver/libs/ folder if the files are .java just edit compile to .class and compile through Eclipse or which program you prefer.

    edit:
    sry made a mistake located at loginserver/libs/

    honestly tho login server only handles login game server is where bugs and fixing is required.

    @FredZem

    i uploaded the login source here:
    http://forum.ragezone.com/f1000/rele...ource-1143207/


    just follow this compile guide to compile it.
    Last edited by Aznkidd235; 06-01-18 at 07:13 PM.

  11. #11
    Enthusiast mysteriocrude is offline
    MemberRank
    Nov 2009 Join Date
    34Posts

    Re: [Guide] How to compile source

    Where can I get gameserver2.jar and where to put it when i get it?

  12. #12
    Proficient Member w3bm4ster is offline
    MemberRank
    May 2014 Join Date
    CanadaLocation
    154Posts

    Re: [Guide] How to compile source

    Where's the gameserver2.jar? Same question here.

  13. #13
    Account Upgraded | Title Enabled! Elssair is offline
    MemberRank
    Dec 2013 Join Date
    334Posts

    Re: [Guide] How to compile source

    Only needs to delete 2 of "gameserver2.jar" into *.bat file guys

  14. #14
    Proficient Member w3bm4ster is offline
    MemberRank
    May 2014 Join Date
    CanadaLocation
    154Posts

    Re: [Guide] How to compile source

    I'm not sure if it's ok but I just rename gameserver2.jar (in bat) to gameserver.jar.

  15. #15
    Enthusiast mysteriocrude is offline
    MemberRank
    Nov 2009 Join Date
    34Posts

    Re: [Guide] How to compile source

    Renamed the gameserver2.jar to gameserver.jar at the bat, works!
    Okay that bat took awhile running creating class. maybe my pc is bad lol.

    So I've downloaded eclipse java oxygen, import the com folder as shown below.

    and then export.

    Should I export is as Java - Jar files and then finish like this below?


    Oh! and after that where should I put the jar file?



Page 1 of 3 123 LastLast

Advertisement