I just found a bigger better explanation from an unknown autor you migth have 
to care when using JAVA and a Windows System
Josef

....

JAVA_HOME vs java.home 
What's the difference between JAVA_HOME and java.home? JAVA_HOME is the JDK 
install directory, e.g., C:\jdk5. It's meant to be set as an environment 
variable and referenced in Windows batch files or Unix scripts. I always have 
it in my Windows Control Panel and .tcsh files, along with other common 
environment variables. Some Java applications use the name jdk.home for this 
purpose, which I think is a better name. But JAVA_HOME has been used since the 
beginning and is now a convention.

java.home is the JRE install directory, e.g., C:\jdk5\jre, or C:\Program 
Files\Java\jre1.5.0_06. Unlike JAVA_HOME, I never seen java.home as an 
environment variable. java.home is a build-in Java system property, whose value 
is the JRE install directory. Since all Java system properties are also exposed 
as Ant build properties, you can also use ${java.home} in build files.

Would jre.home be a better name? Maybe, but I don't think Sun will change it.

Therefore, java.home is always there inside JVM, whereas JAVA_HOME exists 
mainly in your shell environment and you may pass it to JVM as a system 
property. Why do we still need JAVA_HOME? Well, there are good reasons:
*       You can add $JAVA_HOME/bin to the beginning of your PATH, to make sure 
you always invoke the right java program. On Windows, java.exe is duplicated in 
several places, for instance %JAVA_HOME%\bin\java.exe, 
$JAVA_HOME\jre\bin\java.exe, and %SystemRoot%\system32\java.exe. Without have 
$JAVA_HOME/bin at the beginning of the PATH, a java command will always resolve 
to %SystemRoot%\system32\java.exe, which may not be what you want. The same 
problem can also exist in Linux/Solaris.
*       Some Java application runtime needs to use tools/libraries only 
available in JDK. For example, web containers need tools.jar in JDK to compile 
JSP pages, and ejb containers also need to invoke javac/rmic tools in JDK. So 
the build-in system property java.home is not sufficient.

....



-----Ursprüngliche Nachricht-----
Von: Enrique Gaona [mailto:[email protected]] 
Gesendet: Dienstag, 7. September 2010 18:26
An: Maven Users List
Betreff: Maven failing due to javac path issue -- Windows



Hi,
I'm trying to build a project on Windows (believe me, this is not my first
choice) and its failing because Maven can't find javac.   The error message
being returned "Failure executing javac,  but could not parse the error:
The system cannot find the path specified."      Looking at the debug
output, I see this,  [DEBUG]   (f) executable = null/bin/javac.  Is there a
way to rectify this problem, given the fact JAVA_HOME, M2_HOME, and PATH
variables have been set correctly?   Thanks.


Output from the variables:
C:\RTC-data\workspace>echo %JAVA_HOME%
C:\IBM\ibm-java-sdk-60-win-i386\sdk

C:\RTC-data\workspace>echo %M2_HOME%
C:\apache-maven-2.2\apache-maven-2.2.1

C:\RTC-data\workspace>echo %PATH%
C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files
\IBM\Infoprint Select;C:\Notes;C:\Program Files\XLView;C:\lotus
\compnent;C:\Utilities;C:\Program Files\Common Files\Lenovo;C:\pr
ogram files\ibm\personal communications\;C:\Program Files\IBM\Trace
Facility\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\ThinkPad
\ConnectUtilities;C:\Program Files\IBM\RationalSDLC\common;C:\ap
ache-maven-2.2\apache-maven-2.2.1\bin;C:\IBM\ibm-java-sdk-60-win-i386\sdk
\bin


Build output error:

[INFO]
------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] Compilation failure
Failure executing javac,  but could not parse the error:
The system cannot find the path specified.


[INFO]
------------------------------------------------------------------------
[DEBUG] Trace
org.apache.maven.BuildFailureException: Compilation failure
Failure executing javac,  but could not parse the error:
The system cannot find the path specified.


        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals
(DefaultLifecycleExecutor.java:715)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle
(DefaultLifecycleExecutor.java:556)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal
(DefaultLifecycleExecutor.java:535)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures
(DefaultLifecycleExecutor.java:387)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments
(DefaultLifecycleExecutor.java:348)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute
(DefaultLifecycleExecutor.java:180)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
        at org.apache.maven.cli.compat.CompatibleMain.main
(CompatibleMain.java:60)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:48)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:600)
        at org.codehaus.classworlds.Launcher.launchEnhanced
(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode
(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation
failure
Failure executing javac,  but could not parse the error:
The system cannot find the path specified.


        at org.apache.maven.plugin.AbstractCompilerMojo.execute
(AbstractCompilerMojo.java:516)
        at org.apache.maven.plugin.CompilerMojo.execute
(CompilerMojo.java:114)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo
(DefaultPluginManager.java:490)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals
(DefaultLifecycleExecutor.java:694)
        ... 17 more
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Tue Sep 07 10:25:16 CDT 2010
[INFO] Final Memory: 13M/40M
[INFO]
------------------------------------------------------------------------

Enrique

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to