Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error running javac.exe compiler

 
Deepak Jain
Ranch Hand
Posts: 637
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ?
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Sachin Ramaprasad
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18214
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?"
 
Sachin Ramaprasad
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18214
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
snehal shinde,
Your post was moved to a new topic.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic