permaculture playing cards*
The moose likes JBoss/WildFly and the fly likes com.sun.tools.javac.Main is not on the classpath With JBOSS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "com.sun.tools.javac.Main is not on the classpath With JBOSS" Watch "com.sun.tools.javac.Main is not on the classpath With JBOSS" New topic
Author

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

Santosh Raveendran
Ranch Hand

Joined: Jun 29, 2008
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

please advice why this error is coming and how to fix.

i am able to execute the same application with tomcat 5.0


Thanks





SCJP 1.4,SCWCD5, SCBCD5
Thanks, Santhosh
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9962
    
163

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.

[My Blog] [JavaRanch Journal]
Santosh Raveendran
Ranch Hand

Joined: Jun 29, 2008
Posts: 83
jai

but the same works with tomcat .

thanks
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9962
    
163

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

Joined: Jul 20, 2005
Posts: 9962
    
163

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

Joined: Jun 29, 2008
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

Joined: Jun 29, 2008
Posts: 83
jai

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

thanks for your time
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    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.


JBoss In Action
Santosh Raveendran
Ranch Hand

Joined: Jun 29, 2008
Posts: 83
peter

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

thanks
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

That's probably because the warning message you are seeing comes from the JBoss run script.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: com.sun.tools.javac.Main is not on the classpath With JBOSS
 
Similar Threads
Not able to run JSP
Ant xml script & javac + JAVA_HOME classpath
Basic Doubts
Build Getting Failed
Error :Unable to find a javac compiler