# com.sun.tools.javac.Main is not on the classpath With JBOSS

Santosh Raveendran
Ranch Hand
Posts: 83
Hi

When i am trying run an application in JBOSS 4.0 via eclipse 3.3 i am getting the below exception

Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK

i had set the below enviorment variables

JAVA_HOME C:\Program Files\Java\jdk1.5.0_04

PATH C:\Program Files\Java\jdk1.5.0_04\bin

and when i check in the Ant>Runtime>GlobalEntries its pointing to C:\Program Files\Java\jdk1.5.0_04\lib\tools.jar

i am able to execute the same application with tomcat 5.0

Thanks

Jaikiran Pai
Marshal
Posts: 10447
227
JAVA_HOME C:\Program Files\Java\jdk1.5.0_04

Its always recommended that you do not install Java or any Java applications including JBoss, in a folder containing a space in its path name. I would recommend that you move the JDK installation to some place else (Ex: C:\Java\jdk1.5.0_04) and set the JAVA_HOME appropriately. See if that helps.

Santosh Raveendran
Ranch Hand
Posts: 83
jai

but the same works with tomcat .

thanks

Jaikiran Pai
Marshal
Posts: 10447
227
Please try it once and if it does not work then report back with the details.

Jaikiran Pai
Marshal
Posts: 10447
227
And also try running JBoss from the command prompt first. If it starts up successfully, we then know that the issue is somewhere in Eclipse settings.

Santosh Raveendran
Ranch Hand
Posts: 83
jai

i am able to run jboss from command prompt using the JBoss.bat file, but when running from eclipse the issue is coming

thanks

Santosh Raveendran
Ranch Hand
Posts: 83
jai

The issue is fixed i had added tools.jar as external jar by editing the installed JRE and its working

Peter Johnson
author
Bartender
Posts: 5852
7
You might also want to add an SDK to the Installed JREs within Eclipse and use that JDK ar the default JRE for Eclipse.

Santosh Raveendran
Ranch Hand
Posts: 83
peter

The strange thing is that with tomcat there is no error.

thanks

Peter Johnson
author
Bartender
Posts: 5852
7
That's probably because the warning message you are seeing comes from the JBoss run script.