Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Santosh Raveendran
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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




 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jai

but the same works with tomcat .

thanks
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please try it once and if it does not work then report back with the details.
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
peter

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

thanks
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's probably because the warning message you are seeing comes from the JBoss run script.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic