Page 1 of 1

Question about Cloning & Compile L2J

Posted: Thu Mar 30, 2017 3:32 pm
by ChrisJH
Hello, I'm trying to clone and compile the l2j project through eclipse,

tried with both develop or master branch.. followed this guide
with the only change of the git location added the new one (https://bitbucket.org/l2jserver/...)

I ticked the "import all existing projects after clone finishes" but the project dIdn't load
so I manually pressed on git repository and clicked "import project" .. the project came up and showed on project explorer but..
tons of errors , 37.769 errors what I'm doing wrong?

http://imgur.com/a/0qNUa

Re: Question about Cloning & Compile L2J

Posted: Fri Mar 31, 2017 4:30 am
by Zoey76
There are some minor issues on the Gradle script in master branch that are already fixed in develop branch.

You can switch to develop branch, and remove and re-import datapack (should import core as well).

Let me know if that works.

Re: Question about Cloning & Compile L2J

Posted: Fri Mar 31, 2017 5:58 am
by ChrisJH
I tried both develop and master,

I followed what u said, deleted projects, re-imported datapack develop and then core, and again I got 38k errors,

I use w10, eclipse neon3 with only thing added from eclipse marketplace "Buildship Gradle Integration 2.0" (saw that on l2j wiki), last jdk and correct java_home variable, is something I doing wrong?

as I understand the errors are because datapack doesn't sees core, error example "import com.l2jserver...." (This Import cannot be resolved"

Sorry for the trouble, tnx for the help :)

Re: Question about Cloning & Compile L2J

Posted: Fri Mar 31, 2017 6:48 am
by Zoey76
Please check that the project folders are L2J_Server and L2J_DataPack.

Also check that L2J_DataPack's .classpath files looks like this:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
	<classpathentry kind="src" path="dist/game/data/scripts"/>
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
	<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
	<classpathentry kind="src" path="/L2J_Server"/>
	<classpathentry kind="output" path="bin"/>
</classpath>
If you don't want to manually change the folder names, edit this .classpath file and change <classpathentry kind="src" path="/L2J_Server"/> to <classpathentry kind="src" path="/l2j_server"/>

let me know if this works.

Re: Question about Cloning & Compile L2J

Posted: Fri Mar 31, 2017 7:15 am
by ChrisJH
l2jdatapack's classpath isn't like u said

it is :

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
	<classpathentry kind="src" path="dist/game/data/scripts"/>
	<classpathentry kind="lib" path="gradle/wrapper/gradle-wrapper.jar"/>
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
	<classpathentry kind="output" path="bin"/>
</classpath>
also project's name is in non caps mode but same as u said .. so it is l2j_datapack and l2j_server

..
so I manually change .classpath to what u said, and I rename the projects to caps?
I ll try it now

Re: Question about Cloning & Compile L2J

Posted: Fri Mar 31, 2017 7:31 am
by ChrisJH
Ok it seems that datapack's errors fixed, but there are 1k errors on server side, maybe I got to change .classpath of server also ?

some errors just in case they help :
import org.mockito...
import org_testing...
the import cannot be resolved

also after I did the changes this error appeared on eclipse:

http://imgur.com/a/uuKUU

thanks again for the help

Re: Question about Cloning & Compile L2J

Posted: Fri Mar 31, 2017 9:12 am
by ChrisJH
Okay I found the solution, with some search on google,

so I ll post it in case someone got the same problem with me

I went into my account folder on w10, found folder ".gradle" went into wrapper and then dists and deleted all folders there should be 1 or 2.

then opened eclipse, deleted projects and then went on File->Import, expand Gradle -> Import Gradle project
and it downloaded again the gradle and then the project load without errors and I could build successfully !!

the problem was my gradle was corrupted...

that post helped me also :
sahar wrote:
I got it, then how do I build it?

So far if anyone is interested a guide in details:
1) Install Gradle Buildship
* Open Eclipse
* Go to Help menu -> Eclipse Marketplace
* Search for Gradle Buildship
* Install the first plugin that appears
* Restart eclipse when it asks
2) Clone project
* Clone https://github.com/L2J/L2J_Server.git and https://github.com/L2J/L2J_DataPack.git as you would normally do
* Go to File menu -> Import...
* Expand Gradle -> Gradle Project
* Select the directory where you cloned L2J_Server and click finish
* Once done do the same to L2J_DataPack
3) Build project
* In the line of tabs (where you see Console, Problems etc) press Gradle Tasks
* Right click the project and click Run Default Gradle Tasks
Thanks for everything !