Problema de Eclipse con Maven build y JDK al generar Qclasses en Querydsl
Cuando agrego este código a continuación en mi pom.xml
para soportar Querydsl
<plugin>
<groupId>com.mysema.maven</groupId>
<artifactId>apt-maven-plugin</artifactId>
<version>1.0.6</version>
<executions>
<execution>
<goals>
<goal>process</goal>
</goals>
<configuration>
<outputDirectory>target/generated-sources/java</outputDirectory>
<processor>com.mysema.query.apt.jpa.JPAAnnotationProcessor</processor>
</configuration>
</execution>
</executions>
</plugin>
Recibí este error al construir con Eclipse. Creo que tiene relación con classpath y JDK jars
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.0.6:process:default:generate-sources)
.classpath :
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v8.0">
<attributes>
<attribute name="owner.project.facets" value="jst.web"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
Información adicional :
Mi instalación maven
JAVA_HOME : C:\Program Files\Java\jdk1.7.0_45
RUTA : %JAVA_HOME%\bin;
8 answers
SOLUCIÓN 1
Siguiendo este enlace
" El complemento Maven APT tiene un problema conocido que impide su uso directamente desde Eclipse. Los usuarios de Eclipse deben crear la consulta Querydsl escribe manualmente ejecutando el comando mvn generate-sources at pedir."
Así que ejecuté la línea de comandos mvn generate-sources
en mi proyecto floder con console cmd
y obtuve mis Qclasses generados.
SOLUCIÓN 2 de @informatik01 comentario
Podemos especificar explícitamente JVM en el eclipse.ini
así:
-vm
C:\Program Files\Java\jdk1.7.0_45\bin\javaw.exe
-vmargs
...
La opción -vm
debe aparecer antes de la opción -vmargs
y para obtener más información, lea el comentario @informatik01 a continuación.
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-03-06 19:20:36
Puedes probar con esto en el pom:
<plugin>
<groupId>com.mysema.maven</groupId>
<artifactId>apt-maven-plugin</artifactId>
<version>1.0.6</version>
<executions>
<execution>
<goals>
<goal>process</goal>
</goals>
<configuration>
<outputDirectory>target/generated-sources/java</outputDirectory>
<processor>com.mysema.query.apt.jpa.JPAAnnotationProcessor</processor>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>1.7</version>
<scope>system</scope>
<systemPath>${java.home}/../lib/tools.jar</systemPath>
</dependency>
</dependencies>
</plugin>
Y ver si cambia algo. Debería forzar las herramientas.tarro en el camino de construcción.
Editar. dado que eso no ayudó, intente especificar
-vm
D:/work/Java/jdk1.6.0_13/bin/javaw.exe
En eclipse.ini (líneas separadas son importantes), como se explica en este hilo.
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-05-23 12:18:22
<groupId>com.mysema.maven</groupId>
<artifactId>maven-apt-plugin</artifactId>
<version>1.0.6</version>
<executions>
<execution>
<goals>
<goal>process</goal>
</goals>
<configuration>
<outputDirectory>target/generated-sources/java</outputDirectory>
<processor>com.mysema.query.apt.jpa.JAPAnnotationProcessor</processor>
</configuration>
</execution>
</executions>
</plugin>
Agregue el plugin, lo resolverá
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-03-05 04:41:26
Este problema me estaba sucediendo porque, como se mencionó anteriormente, Eclipse se estaba ejecutando a través del JRE en lugar del JDK.
Lo resolví agregando %JAVA_HOME%\bin al frente de mi variable de entorno PATH.
Descubrí qué estaba usando JVM eclipse leyendo: Averigüe en qué se está ejecutando JVM Eclipse
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-05-23 12:18:22
Si compilas por shell commond como mvn install. A continuación, ejecute este comando en la ventana de shell o cmd: echo CLASS CLASSPATH. Este comando muestra su classpath.
Si está utilizando Eclipse, abra Ventana > Preferencias > Java > JRE instalados, asegúrese de que sus JRE instalados sean de ubicación raíz jdk. Para mí, lo es C:\Java\jdk1.7.0_51
Espero que ayude.
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-06-30 02:54:17
Intente actualizar el JDK en Eclipse de la siguiente manera:
Establecer el JRE en
Mira la ruta de abajo-tener program files
(pero en su ruta mencionada no está teniendo program files
en su ruta, por lo general java y todos los programas se instalan en program files
así que asegúrese de que la ruta)
Window->Preferences...->Java->Installed JREs:
JRE type: Standard VM JRE
Name: jdk1.6.0_18
JRE home directory: C:\Program Files (x86)\Java\jdk1.6.0_18
Alos asegúrese de que JAVA_HOME
la ruta está configurada correctamente a JDK\bin
correctamente (sin espacios y todos en esa ruta)
Intente copiar su JDK
a una ubicación diferente y actualice su JAVA_HOME
con esa nueva ubicación.
Hágamelo saber para cualquier otro asunto.
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-06-30 02:55:54
No olvide comprobar la configuración del Entorno de ejecución en la Configuración de su Proyecto Eclipse: Ruta de compilación del proyecto -> Bibliotecas -> Biblioteca del Sistema JRE.
Si esto está mal (por ejemplo, jre), cambie esto a un jdk uno.
En mi caso, esto resolvió el problema ("Necesita ejecutar build con JDK o tener herramientas.jar al classpath." desaparecer).
Luego el aprox. cuarta línea en el Maven Ejecutar cambios en el Registro (por ejemplo)
...
Java home: C:\Program Files\Java\jre1.8.0_66
....
A
...
Java home: C:\Program Files\Java\jdk1.8.0_66\jre
...
Espero que esto ayude.
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-12-28 20:36:40
Había hecho todo lo sugerido anteriormente, pero en vano. Finalmente, debido a que estaba configurando un nuevo equipo, me di cuenta de que no tenía una variable JAVA_HOME
configurada.
Así que todo lo que hice fue agregar la variable JAVA_HOME
a las variables de mi sistema y establecerla en una ruta JDK: C:\Program Files\Java\jdk1.8.0_172
Y voila - mvn generate-resources
comenzó a trabajar de nuevo.
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-05-18 20:39:29