aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Error running javac.exe compiler    Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Error running javac.exe compiler    " Watch "Error running javac.exe compiler    " New topic
Author

Error running javac.exe compiler

Deepak Jain
Ranch Hand

Joined: Aug 05, 2006
Posts: 637
Hi,
When i build my project using ant , I get a error "Error running javac.exe compiler" I have JDK installed. I have my path variable pointing to javac.
Please help me to fix this issue.
BUILD FAILED
C:\Documents and Settings\kumarkud\workspace\ipm\build-install.xml:145: Error running javac.exe compiler
Thanks
Deepak


SCJP, SCWCD, SCBCD
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

1. Is your compiler in the PATH ? Try to type "javac" at the command prompt. If javac is not found, then you should put your bin directory in the PATH.
For example, in Windows, SET PATH=c:/jdk1.5.0_07/bin;%PATH%
2. Are you using the "executable" attribute of the javac task ?


[My Blog]
All roads lead to JavaRanch
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

Another thing to look for - make sure that the version of Java on the PATH, and pointed at by JAVA_HOME - is a JDK - *not* just a JRE.


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Sachin Ramaprasad
Greenhorn

Joined: Sep 01, 2009
Posts: 6
Hi,
I'm also facing same issue with this. But i'm getting an error like this:
Error running "C:\Program Files\Java\jdk1.5.0_16\bin\javac" compiler
And i'm using 'executable' & 'compiler' as the parameter to the javac task.

Please help!

Thanks.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15641
    
  15

Sachin Sr wrote:Hi,
I'm also facing same issue with this. But i'm getting an error like this:
Error running "C:\Program Files\Java\jdk1.5.0_16\bin\javac" compiler
And i'm using 'executable' & 'compiler' as the parameter to the javac task.

Please help!

Thanks.


Isn't there an explanatory message as well? Something like "Program not found?"


Customer surveys are for companies who didn't pay proper attention to begin with.
Sachin Ramaprasad
Greenhorn

Joined: Sep 01, 2009
Posts: 6
No. Nothing as such. The main idea that i want to use executable and compiler attribute in my javac task in ANT is because of this error that i'm getting:

[javac] <path>\JMSMessageSender.java:25: type parameters of <T>T cannot be determined; no unique maximal instance exists for type variable T with upper bounds T,javax.jms.Message
[javac] return builder.buildMessage(session);

I thought this particular java file is unable to compile with the mixed java version that i had. Now i've uninstalled the other Java version and only left with one version i.e., "1.5.0_16".

Does anybody have ever seen this type of error. And Fyi, my ANT build.xml file is able to compile all other JAVA files except this one alone. Your help is greatly appreciated.

Thanks,
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15641
    
  15

Java isn't one of those "Highlander-type" systems (There Can Be Only One), so you didn't need to uninstall other JRE's and/or JDK's. Ant will use whichever JDK was pointed to by the JAVA_HOME environment variable when you run Ant. Which is why Nathan suggested you check it. The PATH isn't important in the selection of which javac.exe to use, but JAVA_HOME is critical.

But it looks to me like you did supply the missing additional messages after all! It's not having a problem getting javac to run, but rather that you're getting a compilation error. Which is a big difference.

The source code in question is doing something esoteric with a parameterized (generic) type. And to tell the truth, I can't make sense of that message, either. I'd google for the message and see if somewhere out there there's a better explanation of what that message means.
Sachin Ramaprasad
Greenhorn

Joined: Sep 01, 2009
Posts: 6
Thanks for your quick response.

I was able to get rid of this issue by removing the character "<T>T" in the source code and it compiled fine.

But I'm getting another different issue with another java file.
[javac] D:\classpath\com\ts\hostmsg\AggregatorQueueListenerMDB.java:15: illegal start of expression
[javac] }
[javac] ^
[javac] 1 error

Any idea how to get rid of this error?
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5779
    
    7

snehal shinde,
Your post was moved to a new topic.


JBoss In Action
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error running javac.exe compiler
 
Similar Threads
Emma Coverage report Error
Problem in hudson build process
Error running javac.exe compiler
Error running javac.exe compiler
Ant: Error running javac compiler