• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Error : Failure executing javac

 
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

While executing the "mvn clean install" got this error :


can some body point it why tis error?

Thanks,
Tanzy.
 
Sheriff
Posts: 22683
128
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The path to your compiler has a space in it so it should be quoted: "C:\Program Files\...". Without these quotes the shell will see one argument "C:\Program" and another argument with the rest (or more arguments if the rest also has a space).
 
Tanzy Akhtar
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Rob for the response.

What you said, is perfect.
But getting this error while running mvn command, not for others like running ant command or
running simple javac command.

What special in the case maven?
Is it kind of bug in maven or something else?

Thaks,
Tanzy.
 
Ranch Hand
Posts: 282
Eclipse IDE PHP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check your JAVA_HOME environment variable. You might need to add quotes to it.
 
Tanzy Akhtar
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Michael for the response.
Yes you are correct if i will put quotes on Java_Home's value, it will work.

But the same question again, why this is needed in case of running mvn command.
Its not needed when using other commands like javac on command prompt etc.
 
Michael Angstadt
Ranch Hand
Posts: 282
Eclipse IDE PHP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tanzy Akhtar wrote:But the same question again, why this is needed in case of running mvn command.
Its not needed when using other commands like javac on command prompt etc.



javac doesn't use the JAVA_HOME variable, but I'm pretty sure Maven does.
 
Marshal
Posts: 76452
366
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Probably too difficult a question for "beginning". Moving thread.
 
Tanzy Akhtar
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Michael for the response.

Michael Angstadt wrote:javac doesn't use the JAVA_HOME variable, but I'm pretty sure Maven does.


So one can conclude that if any program uses JAVA_HOME, There is two way to avoid above error-
1. If java is insatlled in "Program Files", then kindly put JAVA_HOME value in ""(quotes).
2. Otherwise, java should be installed in such directory, which doesn't have spaces in their name.

Am i right Michael?
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As to why some apps working and others not working - some apps, in their batch files, already provide the quotes, others don't. Personally, I recommend never to install the JDK within Program Files - mine is at c:\apps\java\jdk1.6.0_20.
 
Michael Angstadt
Ranch Hand
Posts: 282
Eclipse IDE PHP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As a developer though, you should always account for the fact that paths can contain spaces. This is more likely to occur in Windows than *nix thanks to "Document and Settings" and "Program Files", but is possible in any OS. Especially in user directories where users I think tend to want to make their files and directories more "human readable" by including spaces, capitalization, etc.
 
Tanzy Akhtar
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Michael, Peter, Rob Thank you all for the response.

Well, Peter believe it or not, I also followed erlier the same path to insatll any application as "c:\apps".
 
My favorite is a chocolate cupcake with white frosting and tiny ad sprinkles.
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic