project uses wrong jdk

38 views
Skip to first unread message

ossi

unread,
Sep 19, 2007, 3:54:10 AM9/19/07
to Q for Eclipse users list
hallo

maybe i am doing something wrong... but i need some help :)

i was using m2eclipse and decided to give q4e a try. i am using a
clean eclipse 3.3.0 (the j2ee download), installed q4e version 0.2.1
from the update site and checked out the projects. in addition i
copied a java 1.6 jre into <eclipse>/jre (simple way to run eclipse
with 1.6). i then configured java 1.4 as default jre/jdk in eclipse. i
did this for the projects too where needed.

so: when i try to 'locally install' the project the build fails.

09:27:27 CEST info Compilation failure
Unable to locate the Javac Compiler in:
E:\eclipse\eclipse-3.3.0-q4e\jre\..\lib\tools.jar
Please ensure you are using JDK 1.4 or above and
not a JRE (the com.sun.tools.javac.Main class is required).
In most cases you can change the location of your Java
installation by setting the JAVA_HOME environment variable.


Unable to locate the Javac Compiler in:
E:\eclipse\eclipse-3.3.0-q4e\jre\..\lib\tools.jar
Please ensure you are using JDK 1.4 or above and
not a JRE (the com.sun.tools.javac.Main class is required).
In most cases you can change the location of your Java
installation by setting the JAVA_HOME environment variable.

there seems to be no reason why this project tries to run 'install'
with that jre. the project points to a jdk which is ignored. setting
JAVA_HOME in eclipse did not help.

any hints or suggestions would be welcome :)

thanks
regards

ossi

erle mantos

unread,
Sep 19, 2007, 4:10:46 AM9/19/07
to q4e-...@googlegroups.com
Have you tried setting your PATH to point to the JDK's /bin first
before anything else
so that the JDK installation will be used to launch Eclipse ?


--
A world without C++ is chaos.

ossi

unread,
Sep 19, 2007, 6:23:03 AM9/19/07
to Q for Eclipse users list
hallo

thanks for you reply.

i tried to copy the jdk 1.6 into the jre folder. the projects now at
least tries to compile. yet its the wrong jdk. we have projects that
rely on 1.4, some will be moved to 1.5, some not. so both jdk's need
to be configured in eclipse. q4e should not use the system default.
eclipse creates an own environment and ignores external settings
(which is sometimes boring but the only solution to allow multiple
jdk's to be used at the same time).

should this be reported to the bug tracker?
currently the projects compile with a 1.6 jdk for version 1.4. a bad
thing. but at the moment it at least tries to compile.

the multimodule built only runs for the first module. the second
module fails since the classes of module1 are missing. how does q4e
resolve dependencies? the dependant jar's are in the local repository,
also the project in eclipse is opened. do i need to manually define
project dependencies? or is it enough to include the plugin
dependencies in the project classpath?

thanks a lot :)


On 19 Sep., 10:10, "erle mantos" <eman...@gmail.com> wrote:
> Have you tried setting your PATH to point to the JDK's /bin first
> before anything else
> so that the JDK installation will be used to launch Eclipse ?
>

erle mantos

unread,
Sep 19, 2007, 6:42:59 AM9/19/07
to q4e-...@googlegroups.com
Hmmm .. there have been a discussion regarding this, see

http://groups.google.com/group/q4e-dev/browse_thread/thread/18f458544f187749

Maybe you could jive in that discussion and share your thoughts ..

On 9/19/07, ossi <knu...@gmail.com> wrote:
>

Genesis Deiparine

unread,
Sep 19, 2007, 8:17:51 AM9/19/07
to q4e-...@googlegroups.com
hi,

you can create a batch file so you wont have to type all over again everything :
filename :  "eclipseq4elauncher.bat"
eclipse -vm "C:\Program Files\Java\jdk1.5.0_09\bin\javaw.exe"
exit

note:
1.) make sure to locate the path of your javaw.exe in in your ..\java\jdk
2.) make sure in your environment variable you have a variable: JAVA_HOME with a  value :  C:\Program Files\Java\jdk1.5.0_09
     then just append this info in your system Path :  ;%JAVA_HOME%\bin
    

hope this helps,
Genesis

Abel Muiño

unread,
Sep 19, 2007, 8:35:09 AM9/19/07
to q4e-...@googlegroups.com
Some additional notes...

Using a later JDK should be fine for most uses if you watch out for some caveats:
1.- Do not use dependencies which rely on a JDK higher than your project.
2.- Remember to set the target version for the compiler plug-in to the right value for the each project.
3.- Don't use API not present on the target java version for your project.

This is not specific to q4e (for example, also applies to eclipse's JDT).

Is this set-up not valid for your scenario?

If it is not, then please file a new issue with an explanation so we can consider it for future releases. Right now Q4E is not starting a new process to run maven builds, which provides much better integration. This means that the same JDK used to start eclipse is also used for running maven.

If you really need to run maven with an specific JDK, which is different than the one used by eclipse, presently the only option is to configure a standalone maven build using the "external tools" launch menu in Eclipse.

On 9/19/07, erle mantos <ema...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages