Forums

angle-left Back

Resolved - Liferay IDE - Error running javac.exe compiler

SX
Stan M, modified 7 Years ago.

Resolved - Liferay IDE - Error running javac.exe compiler

Regular Member Posts: 208 Join Date: 1/27/08 Recent Posts
Hi,

I have followed the installation of LP 6.0.2, SDK 6.0.2, and Eclipse.

http://www.liferay.com/community/wiki/-/wiki/Main/Liferay+IDE+Installation+Guide

I am able create and deploy a simple portlet. Now I am testing the Liferay Service.

For the service.xml file, I have the following :


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE service-builder PUBLIC "-//Liferay//DTD Service Builder 6.0.0//EN" "http://www.liferay.com/dtd/liferay-service-builder_6_0_0.dtd">
<service-builder package-path="com.test.test.portlet">
    <author>root</author>
    <namespace>test</namespace>

        <entity name="TestEntry" table="CC_TestEntry" uuid="true" local-service="true" remote-service="false">

                <!-- PK fields -->

                <column name="entryId" type="long" primary="true" />

                <!-- Group instance -->

                <column name="groupId" type="long" />

        </entity>
       
</service-builder>


When I try to build it, I get the following error :




[Console output redirected to file:C:\eclipse\workspace\.metadata\.plugins\com.liferay.ide.eclipse.sdk\sdk.log]

Buildfile: C:\ide\liferay-plugins-sdk-6.0.2\portlets\test-portlet\build.xml

build-service:
       [mkdir] Created dir: C:\ide\liferay-plugins-sdk-6.0.2\portlets\test-portlet\docroot\WEB-INF\service
       [mkdir] Created dir: C:\ide\liferay-plugins-sdk-6.0.2\portlets\test-portlet\docroot\WEB-INF\sql
        [java] Loading jar:file:/C:/ide/liferay-portal-6.0.2/tomcat-6.0.26/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/system.properties
        [java] Loading jar:file:/C:/ide/liferay-portal-6.0.2/tomcat-6.0.26/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/portal.properties
        [java] Loading jar:file:/C:/ide/liferay-portal-6.0.2/tomcat-6.0.26/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/com/liferay/portal/tools/dependencies/portal-tools.properties
        [java] 17:37:40,109 INFO  [PortalImpl:276] Global lib directory /C:/ide/liferay-portal-6.0.2/tomcat-6.0.26/lib/ext/
        [java] 17:37:40,109 INFO  [PortalImpl:296] Portal lib directory /C:/ide/liferay-portal-6.0.2/tomcat-6.0.26/webapps/ROOT/WEB-INF/lib/
        [java] Building TestEntry
        [java] Writing docroot\WEB-INF\src\com\test\test\portlet\service\persistence\TestEntryPersistenceImpl.java
        [java] Writing docroot\WEB-INF\service\com\test\test\portlet\service\persistence\TestEntryPersistence.java
        [java] Writing docroot\WEB-INF\service\com\test\test\portlet\service\persistence\TestEntryUtil.java
        [java] Writing docroot\WEB-INF\src\com\test\test\portlet\model\impl\TestEntryModelImpl.java
        [java] Writing docroot\WEB-INF\src\com\test\test\portlet\model\impl\TestEntryImpl.java
        [java] Writing docroot\WEB-INF\service\com\test\test\portlet\model\TestEntryModel.java
        [java] Writing docroot\WEB-INF\service\com\test\test\portlet\model\TestEntry.java
        [java] Writing docroot\WEB-INF\service\com\test\test\portlet\model\TestEntryClp.java
        [java] Writing docroot\WEB-INF\service\com\test\test\portlet\model\TestEntryWrapper.java
        [java] Writing docroot\WEB-INF\service\com\test\test\portlet\model\TestEntrySoap.java
        [java] Writing docroot\WEB-INF\src\com\test\test\portlet\service\impl\TestEntryLocalServiceImpl.java
        [java] Writing docroot\WEB-INF\src\com\test\test\portlet\service\base\TestEntryLocalServiceBaseImpl.java
        [java] Writing docroot\WEB-INF\service\com\test\test\portlet\service\TestEntryLocalService.java
        [java] Writing docroot\WEB-INF\service\com\test\test\portlet\service\TestEntryLocalServiceUtil.java
        [java] Writing docroot\WEB-INF\service\com\test\test\portlet\service\TestEntryLocalServiceClp.java
        [java] Writing docroot\WEB-INF\service\com\test\test\portlet\service\TestEntryLocalServiceWrapper.java
        [java] Writing docroot\WEB-INF\service\com\test\test\portlet\service\messaging\ClpMessageListener.java
        [java] Writing docroot\WEB-INF\service\com\test\test\portlet\service\ClpSerializer.java
       [mkdir] Created dir: C:\ide\liferay-plugins-sdk-6.0.2\portlets\test-portlet\docroot\WEB-INF\service-classes

compile-java:
       [javac] Compiling 14 source files to C:\ide\liferay-plugins-sdk-6.0.2\portlets\test-portlet\docroot\WEB-INF\service-classes

BUILD FAILED
C:\ide\liferay-plugins-sdk-6.0.2\build-common-plugin.xml:349: The following error occurred while executing this line:
C:\ide\liferay-plugins-sdk-6.0.2\build-common.xml:90: Error running javac.exe compiler

Total time: 6 seconds


---

Any ideas?
p chandru, modified 7 Years ago.

RE: Liferay IDE - Error running javac.exe compiler

New Member Posts: 7 Join Date: 2/19/10 Recent Posts
Hi Stan,


Check your build."username".properties file for that problem.
Also check the environment variables you set it.
May the directory or the path is wrong.



Thanks,


Chandru P
Corné A, modified 7 Years ago.

RE: Liferay IDE - Error running javac.exe compiler

Liferay Legend Posts: 1314 Join Date: 10/3/06 Recent Posts
I experience the same problem.
Did you find any solution yet?
Corné A, modified 7 Years ago.

RE: Liferay IDE - Error running javac.exe compiler

Liferay Legend Posts: 1314 Join Date: 10/3/06 Recent Posts
OK i found it myself so for future reference;

##
## Compiler
##
....
    javac.compiler=modern
    #javac.compiler=org.eclipse.jdt.core.JDTCompilerAdapter


change to

    #javac.compiler=modern
    javac.compiler=org.eclipse.jdt.core.JDTCompilerAdapter
SX
Stan M, modified 7 Years ago.

RE: Liferay IDE - Error running javac.exe compiler

Regular Member Posts: 208 Join Date: 1/27/08 Recent Posts
Thanks for sharing the solution.
JK
Jörg Kuhn, modified 7 Years ago.

RE: Liferay IDE - Error running javac.exe compiler

New Member Posts: 1 Join Date: 12/23/10 Recent Posts
Woderful information. Thankx
Binh Thanh Le, modified 7 Years ago.

RE: Liferay IDE - Error running javac.exe compiler

New Member Posts: 14 Join Date: 8/1/10 Recent Posts
This is really nice, But can anyone explains to me the difference between the two?
I think it would be better if we use the default Sun's Compiler other than the
Eclipse's one ?

Corné Aussems:
OK i found it myself so for future reference;

##
## Compiler
##
....
    javac.compiler=modern
    #javac.compiler=org.eclipse.jdt.core.JDTCompilerAdapter


change to

    #javac.compiler=modern
    javac.compiler=org.eclipse.jdt.core.JDTCompilerAdapter
KB
Kiran Kumar Boyini, modified 5 Years ago.

RE: Liferay IDE - Error running javac.exe compiler

Expert Posts: 287 Join Date: 6/2/11 Recent Posts
Hi,


Me also getting same kind of issue.Could please tell where I can find out the above file.

I mean provide path of the above file. I am using the liferay ide 1.4.0 version and eclipse helios version .

Thanks & Regards,

KiranKumar Boyini.
KB
Kiran Kumar Boyini, modified 5 Years ago.

RE: Liferay IDE - Error running javac.exe compiler

Expert Posts: 287 Join Date: 6/2/11 Recent Posts
Hi,


Me also getting same kind of issue.Could please tell where I can find out the above file.

I mean provide path of the above file. I am using the liferay ide 1.4.0 version and eclipse helios version

Thanks & Regards,

KiranKumar Boyini.
Jasmin Leung, modified 7 Years ago.

RE: Liferay IDE - Error running javac.exe compiler

New Member Posts: 1 Join Date: 1/2/11 Recent Posts
it's very nice of you guys~
NH
Nouran Hafez, modified 7 Years ago.

RE: Liferay IDE - Error running javac.exe compiler

New Member Posts: 5 Join Date: 1/31/11 Recent Posts
Can someone kindly tell me where to find the file that contains the lines specified by Corné Aussems?

Thanks,
Nouran
Corné Aussems, modified 7 Years ago.

RE: Liferay IDE - Error running javac.exe compiler

Liferay Legend Posts: 1314 Join Date: 10/3/06 Recent Posts
I have found it in Galileo here
\eclipse\configuration\org.eclipse.osgi\bundles\304\1\.cp\jdtCompilerAdapter.jar
NH
Nouran Hafez, modified 7 Years ago.

RE: Liferay IDE - Error running javac.exe compiler

New Member Posts: 5 Join Date: 1/31/11 Recent Posts
Thank you Corné for your prompt reply. I found the jdt jar and I placed it in the build class path, but my problem still presists. Now it says

BUILD FAILED
C:\Sources\Liferay Plugins SDK\liferay-plugins-sdk-6.0.2\build-common-plugin.xml:216: The following error occurred while executing this line:
C:\Sources\Liferay Plugins SDK\liferay-plugins-sdk-6.0.2\build-common.xml:90: Class not found: ${org.eclipse.jdt.core.jdtCompilerAdapter}

I created an org.eclipse.jdt.core folder and added the jar file to it. And in the build-common.xml file I changed it to the following,

<target name="compile-java">
        <if>
            <equals arg1="${javac.compiler}" arg2="modern" />
            <then>
                <javac
                    classpathref="${javac.classpathref}"
                         compiler="${org.eclipse.jdt.core.jdtCompilerAdapter}"
                    debug="${javac.debug}"
                    deprecation="${javac.deprecation}"
                    destdir="${javac.destdir}"
                    fork="${javac.fork}"
                    includeAntRuntime="false"
                    memoryMaximumSize="${javac.memoryMaximumSize}"
                    nowarn="${javac.nowarn}"
                    srcdir="${javac.srcdir}"
                />
            </then>


Could you kindly tell me what the problem is? Are there certain steps that need to be done to get it to build successfully without errors?

Thank you in advance for your time emoticon
Corné Aussems, modified 7 Years ago.

RE: Liferay IDE - Error running javac.exe compiler

Liferay Legend Posts: 1314 Join Date: 10/3/06 Recent Posts
Why are you using sdk 602?
I need more info?
Did you follow the instrictions from the wiki?
NH
Nouran Hafez, modified 7 Years ago.

RE: Liferay IDE - Error running javac.exe compiler

New Member Posts: 5 Join Date: 1/31/11 Recent Posts
Hey

I downloaded Liferay Portal Community Edition 6.0 GA3 bundled with Tomcat. And I downloaded the sdk from within Eclipse itself and this version was the one that automatically downloaded. My normal plugin portlet or hook projects work fine. But when I tried to create a new service.xml file and build it the errors occurred as shown in the previous posts.

Which wiki are you referring to?

Thanks again for your help.
Corné Aussems, modified 7 Years ago.

RE: Liferay IDE - Error running javac.exe compiler

Liferay Legend Posts: 1314 Join Date: 10/3/06 Recent Posts
I'm referring to wiki's
http://www.liferay.com/community/wiki/-/wiki/Main/Liferay+IDE+Installation+Guide
and
http://www.liferay.com/community/wiki/-/wiki/Main/Liferay+IDE+Getting+Started+Tutorial

But i always download the sdk from sourceforge.

FYI information there is a new IDE 1.2 out

Liferay IDE Wiki's
Liferay IDE Webinar

Please use the latest IDE and state your Eclipse version and JDK version.
NH
Nouran Hafez, modified 7 Years ago.

RE: Liferay IDE - Error running javac.exe compiler

New Member Posts: 5 Join Date: 1/31/11 Recent Posts
Thank you sooo much Corné. I updated to the latest version of Eclipse and the new Liferay IDE and I changed the compiler lines mentioned earlier in the threads and it worked emoticon

Thanks again!
HB
Horst-Günther Barzik, modified 7 Years ago.

RE: Resolved - Liferay IDE - Error running javac.exe compiler

New Member Posts: 1 Join Date: 6/21/11 Recent Posts
In my opinion the problem arises because liferay may be downloaded as a bundle with eclipse, which in addition contains a JRE. Running ant javac task requires a connection to a JDK, which isn't available then by default.

In case of that problem, check youre eclipse JAVA settings and set to a JDK. Voila. However, there are some other solutions, but this is THE one.

Have fun.
Corné Aussems, modified 6 Years ago.

RE: Resolved - Liferay IDE - Error running javac.exe compiler

Liferay Legend Posts: 1314 Join Date: 10/3/06 Recent Posts
Horst-Gunter is right i forgot to update this;
See images how you could do this
Jay Patel, modified 6 Years ago.

RE: Liferay IDE - Error running javac.exe compiler

Regular Member Posts: 119 Join Date: 2/23/10 Recent Posts
Corné Aussems:
OK i found it myself so for future reference;

##
## Compiler
##
....
    javac.compiler=modern
    #javac.compiler=org.eclipse.jdt.core.JDTCompilerAdapter


change to

    #javac.compiler=modern
    javac.compiler=org.eclipse.jdt.core.JDTCompilerAdapter



Thanks man..This has resolved my problem..
KB
Kiran Kumar Boyini, modified 5 Years ago.

RE: Liferay IDE - Error running javac.exe compiler

Expert Posts: 287 Join Date: 6/2/11 Recent Posts
Hi,

I am also getting same error. Could you please tell me the path of the above files to change above settings.

I am using the eclipse helios version.

Thanks & Regards

KiranKumar Boyini.
MG
Miller Gonzalez, modified 5 Years ago.

RE: Liferay IDE - Error running javac.exe compiler

New Member Posts: 3 Join Date: 11/22/12 Recent Posts
i'm new in java and liferay, where i can modify this configuration... and why is happen now, in the past i don have that issue
Thanks!
TQ
tran quyet, modified 5 Years ago.

RE: Liferay IDE - Error running javac.exe compiler

New Member Posts: 2 Join Date: 7/31/12 Recent Posts
Hi!
I dont understand what you say. You get this error again, do you?
MG
Miller Gonzalez, modified 5 Years ago.

RE: Liferay IDE - Error running javac.exe compiler

New Member Posts: 3 Join Date: 11/22/12 Recent Posts
Hello again , my question is where i can modify this configuration:

##
## Compiler
##
....
javac.compiler=modern
#javac.compiler=org.eclipse.jdt.core.JDTCompilerAdapter
Vishal Panchal, modified 5 Years ago.

RE: Liferay IDE - Error running javac.exe compiler

Expert Posts: 288 Join Date: 5/20/12 Recent Posts
Miller Gonzalez:
Hello again , my question is where i can modify this configuration:

##
## Compiler
##
....
javac.compiler=modern
#javac.compiler=org.eclipse.jdt.core.JDTCompilerAdapter


Hi ,

You can modify this configuration in build.{userid}.properties file.

Thanks&Regards,
Vishal R. Panchal
MG
Miller Gonzalez, modified 5 Years ago.

RE: Liferay IDE - Error running javac.exe compiler

New Member Posts: 3 Join Date: 11/22/12 Recent Posts
thanks, works for me!
Wilson Silva, modified 6 Years ago.

RE: Resolved - Liferay IDE - Error running javac.exe compiler

New Member Posts: 19 Join Date: 6/9/11 Recent Posts
I was having the same problem and I fixed it by updating the Liferay IDE to 1.3
Ranga Rao Bobbili, modified 6 Years ago.

RE: Resolved - Liferay IDE - Error running javac.exe compiler

Regular Member Posts: 152 Join Date: 7/20/07 Recent Posts
Hi All,

I resolved this issue using below steps. i.e. Memorey issue

1. Remove fork attribute from java element
<sdk>\ext\build-common-ext.xml
<java
classname="com.liferay.portal.tools.ExtInfoBuilder"
classpathref="portal.classpath"
fork="true"
maxmemory="256m"
newenvironment="true"
>

2. Remove fork attribute from java element
<sdk>\build-common.xml
<javac
classpathref="${javac.classpathref}"
compiler="${javac.compiler}"
fork="true"
debug="${javac.debug}"
deprecation="${javac.deprecation}"
destdir="${javac.destdir}"
includeAntRuntime="false"
memoryMaximumSize="${javac.memoryMaximumSize}" (fork=false eliminates memoryMaximumSize attribute)
nowarn="${javac.nowarn}"
srcdir="${javac.srcdir}"
/>

Regards,
Ranga Rao B
Adaequare Info Pvt Ltd,
Hyderabad,
India
DP
Diego Pino, modified 5 Years ago.

RE: Resolved - Liferay IDE - Error running javac.exe compiler

New Member Posts: 1 Join Date: 6/27/12 Recent Posts
I got the same issue in Fedora16 ("Class not found: org.eclipse.jdt.core.JDTCompilerAdapter"). I had copied ecj.jar to /usr/share/ant/lib but still didn't work. I found out that I needed to define ANT_HOME variable too:

export ANT_HOME="/usr/share/ant/"
TQ
tran quyet, modified 5 Years ago.

RE: Resolved - Liferay IDE - Error running javac.exe compiler

New Member Posts: 2 Join Date: 7/31/12 Recent Posts
Hello!
I can help you! I solved this problem! Please follow these step:
1. in eclipse, Window -> Preferences -> Java -> Installed JREs -> Add
2. browse to jdk directory, instead of jre directory!
3. ok, tick in the check box to select your jdk -> ok
Good luck!
KB
Kiran Kumar Boyini, modified 5 Years ago.

RE: Resolved - Liferay IDE - Error running javac.exe compiler

Expert Posts: 287 Join Date: 6/2/11 Recent Posts
Thank you


I solved the issue by following your reply in screenshot .


Regards,

KiranKumar Boyini.