Message Boards

Gradle problems on Liferay IDE for a 7.0 project

Iñaki Bergara, modified 3 Years ago.

Gradle problems on Liferay IDE for a 7.0 project

Junior Member Posts: 65 Join Date: 10/30/11 Recent Posts

Hi,

I've been away from liferay for a quite some time, but I now had to perform maintenance on an old project and found myself having to set up the old workspace. So I downloaded eclipse, I installed liferay IDE, made sure I was running java 1.8, switched to the liferay online perspective and there was the view I hadn't beheld in a while... save for one issue: gradle doesn't work. And therefore, I can't build anything.

I never really understood gradle, it was just the thing I clicked on the IDE to build my plugins and services. It just worked. But now it does not and I have no idea what to do. When I used to have a bunch of actions per plugin project, now I have none. And I get a single error stating:

Could not create an instance of Tooling API implementation using the specified Gradle distribution 'https://services.gradle.org/distributions/gradle-3.0-bin.zip'.
Could not create service of type FileSystem using FileSystemServices.createFileSystem().
Could not determine java version from '13.0.2'.	MyProject		line 0	Gradle Error Marker

Now, what instantly comes to mind is that it's mentioning java 13.0.2, which is another jdk I'm running in my system. It must try to use that by default, I suppose. I do however want to use java 1.8, and that's the only installed JRE I have set on eclipse. I would expect that all I need to do is point gradle to use the old java instead of the new one, but I can't figure it out.

I've tried going to eclipse preferences->gradle, adding C:\Program Files\Java\jdk1.8.0_251 on the java home section, but all I get is a small warning sign (maybe a wrong path? but no matter what I try, doesn't seem happy with anything). I've also tried setting it up within gradle.properties, but this file is versioned and I wouldn't get why it doesn't work just now. I really blame the IDE, first and foremost.

Can anyone shed a light on what I need to do to build my plugins, please?

thumbnail
Andre Kreienbring, modified 3 Years ago.

RE: Gradle problems on Liferay IDE for a 7.0 project

Regular Member Posts: 152 Join Date: 12/18/06 Recent Posts

You can put that gradle.properties file in your .gradle folder under the OS Users section. e.g. [Users]\[UserName]\.gradle

Thats out of version control (normally) and can point to the correct Java installation like:

org.gradle.java.home=C:\\Program Files\\Java\\jdk-11

 

Iñaki Bergara, modified 3 Years ago.

RE: RE: Gradle problems on Liferay IDE for a 7.0 project

Junior Member Posts: 65 Join Date: 10/30/11 Recent Posts

Thanks, unfortunately this didn't seem to fix it. I must still be doing something wrong.

So I took the nuclear option: I took my laptop, installed only java 1.8, I took an old eclipse (Neon3) and an old liferay IDE build (3.4) and tried to build it that way. And it worked!

...for the most part. Unfortunately, I'm still running into issues with building my theme: the CSS won't build.

:wars:MainTheme:buildCSSWas passed main parameter 'sass.dir=/' but no main parameter was defined in your arg class

Googling that out led me to here, but I tried the solution proposed and it still wouldn't work. I'm guessing it has to do with the liferay IDE version, so I'm trying different ones to see if one of them builds it. It used to, after all. But if there's a better way, I'm very much open to suggestions.