This week's book giveaway is in the Testing forum. We're giving away four copies of Practical Unit Testing with TestNG and Mockito and have Tomek Kaczanowski on-line! See this thread for details.
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
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 ?
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
posted
0
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.
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?"
One of the most odious afflictions that Business has inflicted on the modern English language is "pro-active". Most of the time it's simply redundantly used in place of the simple old word "active". And a good deal of the rest of the time it means "You're not overworked enough yet, so go out and find more!"
Sachin Ramaprasad
Greenhorn
Joined: Sep 01, 2009
Posts: 6
posted
0
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.
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
posted
0
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