1

I am trying to generate QClasses for Spring Data MongoDb using QueryDSL

following the spring documentation, my plugin entry in pom.xml looks like this

<plugin>    
                <groupId>com.mysema.maven</groupId>
                <artifactId>apt-maven-plugin</artifactId>
                <version>1.1.3</version>
                <executions>
                   <execution>
                        <id>process-common-model</id>
                        <goals>
                            <goal>process</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>target/generated-sources/apt</outputDirectory>
                            <processors>
                                <processor>
                                  org.springframework.data.mongodb.repository.support.MongoAnnotationProcessor
                                </processor>
                            </processors>
                        </configuration>
                    </execution>
                 </executions>
            </plugin>

I get the following error on the execution element

You need to run build with JDK or have tools.jar on the classpath.If this occures during eclipse build make sure you run eclipse under JDK as well (com.mysema.maven:apt-maven-plugin:1.1.3:process:process-common-model:generate-sources)

I have tried to look this up on online and what I understand that is that sts run under installed JRE which is missing tools.jar for this execution. So folks have suggested to change the vm options in sts.ini like this:

-vm D:\jde\jdks\jdk1.6.0_37\bin\javaw.exe

Relevant online links are:

http://forum.spring.io/forum/spring-projects/data/126292-issues-with-querydsl-and-maven-pom-in-eclipse

Eclipse issue with Maven build and JDK when generating Qclasses in Querydsl

I fail to find sts.ini or any such file where vm options can be changed is. I am running STS on a windows machine. I could find STS configuration setting files which looks exactly the same as eclipse.ini based on its contents. So I added -vm options in it and now this file looks like this

-startup
plugins/org.eclipse.equinox.launcher_1.3.201.v20161025-1711.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.401.v20161122-1740
-product
org.springsource.sts.ide
--launcher.defaultAction
openFile
-vmC:\Program Files\Java\jdk1.8.0_121\bin\javaw.exe-vmargs
-Dosgi.requiredJavaVersion=1.8
-Xms40m
-Dosgi.module.lock.timeout=10
-Xverify:none
-Dorg.eclipse.swt.browser.IEVersion=10001
-Xmx1200m

Modifying this file also doesn't resolve this issue.

Can anyone tell me how to go about this issue ? I have been stuck on this the whole day.

Community
  • 1
  • 1
Hary
  • 1,127
  • 4
  • 24
  • 51

1 Answers1

2

Here is the documentation about the eclipse.ini file (the sts.ini file is the same but for STS):

https://wiki.eclipse.org/Eclipse.ini

According to this documentation, you have to put "-vm" on the first line of your ini file, and the path to the javaw.exe on the second line. On the third line, the rest of the ini file starts (with the "-startup" line).

Hope this helps!!!

Martin Lippert
  • 5,988
  • 1
  • 15
  • 18