Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > java.lang.IllegalStateException: No Java compiler available

Reply
Thread Tools

java.lang.IllegalStateException: No Java compiler available

 
 
muttley
Guest
Posts: n/a
 
      08-22-2007
tearing my hair out on this one.
Thuis started as an upgrade issue till i realised that my un-used
tomcat5 installation didn't work either with my test jsp.

I have, in desparation, un-installed all java / tomcat libs and re-
installed only those required to get the
tomcat6-6.0.14-1jpp.noarch.rpm (and the band-waggon) loaded

first I installed java_app_platform_sdk-5_02-linux.bin
this shows (after I set alternatives to point to the /opt/SDK/jdk
direcrtory)

[root@squirrel ~]# javac -version
javac 1.6.0

java shows the same.

I have set the following in profile

CLASSPATH=$JDKHOME:$JDKHOME/lib/tools.jar

JAVA_HOME="/opt/SDK/jdk"
JDKHOME=$JAVA_HOME
JREHOME=$JAVA_HOME/jre
JFCHOME=$JAVA_HOME/jfc
JRECP=$JREHOME/lib/rt.jar

CATALINA_HOME=/usr/share/tomcat6

export JAVA_HOME JDKHOME JREHOME JFCHOME JRECP CLASSPATH CATALINA_HOME

tomcat6.conf: -
JAVA_HOME="/opt/SDK/jdk"

# Where your tomcat installation lives
CATALINA_BASE="/usr/share/tomcat6"
CATALINA_HOME="/usr/share/tomcat6"
JASPER_HOME="/usr/share/tomcat6"
CATALINA_TMPDIR="/var/tmp/tomcat6"


The logs give no indication why it fails it just keeps saying that it
can't find a compiler.

All the posts point to stuff I've already tried (including copying the
tools.jar file into the /bin directory of tomcat6

Anybody got an idea?

 
Reply With Quote
 
 
 
 
Manish Pandit
Guest
Posts: n/a
 
      08-22-2007
On Aug 22, 9:01 am, muttley <ke...@mtel.co.uk> wrote:

> tearing my hair out on this one.
> All the posts point to stuff I've already tried (including copying the
> tools.jar file into the /bin directory of tomcat6
>
> Anybody got an idea?


Do you mean copying the tools.jar to /common/lib of your tomcat
installation ? Copying in /bin will not help.
You can try 'which java' to see where is the java being picked from.
It might not be /opt/SDJ/jdk.

-cheers,
Manish

 
Reply With Quote
 
 
 
 
Lew
Guest
Posts: n/a
 
      08-22-2007
muttley wrote:
> first I installed java_app_platform_sdk-5_02-linux.bin


That isn't Core Java. That's a Sun JEE container.

You want jdk_6u2_linux_i586.bin instead.

> this shows (after I set alternatives to point to the /opt/SDK/jdk
> direcrtory)
>
> [root@squirrel ~]# javac -version
> javac 1.6.0
> java shows the same.


Clearly you haven't uninstalled Java, since the install you cite isn't the JDK.

> I have set the following in profile
>
> CLASSPATH=$JDKHOME:$JDKHOME/lib/tools.jar


Uh, no. Since you set

> JAVA_HOME="/opt/SDK/jdk"
> JDKHOME=$JAVA_HOME


then $JDKHOME is the root of the installation, not the root of a classpath.

You also don't need to include Java itself in its own classpath.

> JREHOME=$JAVA_HOME/jre
> JFCHOME=$JAVA_HOME/jfc
> JRECP=$JREHOME/lib/rt.jar
>
> CATALINA_HOME=/usr/share/tomcat6
>
> export JAVA_HOME JDKHOME JREHOME JFCHOME JRECP CLASSPATH CATALINA_HOME
>
> tomcat6.conf: -
> JAVA_HOME="/opt/SDK/jdk"


Why declare this both places?

> # Where your tomcat installation lives
> CATALINA_BASE="/usr/share/tomcat6"
> CATALINA_HOME="/usr/share/tomcat6"


Again, why declare it both places?

> JASPER_HOME="/usr/share/tomcat6"
> CATALINA_TMPDIR="/var/tmp/tomcat6"
>
>
> The logs give no indication why it fails it just keeps saying that it
> can't find a compiler.


Probably because you haven't set up /usr/bin/java or else included
$JAVA_HOME/bin in your PATH.

In my Linux I've run:

alternatives --install \
/usr/java/java jdk /opt/java/jdk1.6.0_02 1600 \
--slave /usr/java/jre jre /opt/java/jdk1.6.0_02/jre \
--slave /usr/bin/java java /opt/java/jdk1.6.0_02/bin/java \
--slave /usr/bin/rmiregistry rmiregistry \
/opt/java/jdk1.6.0_02/bin/rmiregistry

That ensures that "java" is in my path. You could extend that to include "javac".

--
Lew


 
Reply With Quote
 
muttley
Guest
Posts: n/a
 
      08-23-2007
On 23 Aug, 00:14, Lew <l...@lewscanon.com> wrote:
> muttley wrote:
> > first I installed java_app_platform_sdk-5_02-linux.bin

>
> That isn't Core Java. That's a Sun JEE container.
>
> You want jdk_6u2_linux_i586.bin instead.
>
> > this shows (after I set alternatives to point to the /opt/SDK/jdk
> > direcrtory)

>
> > [root@squirrel ~]# javac -version
> > javac 1.6.0
> > java shows the same.

>
> Clearly you haven't uninstalled Java, since the install you cite isn't the JDK.
>
> > I have set the following in profile

>
> > CLASSPATH=$JDKHOME:$JDKHOME/lib/tools.jar

>
> Uh, no. Since you set
>
> > JAVA_HOME="/opt/SDK/jdk"
> > JDKHOME=$JAVA_HOME

>
> then $JDKHOME is the root of the installation, not the root of a classpath.
>
> You also don't need to include Java itself in its own classpath.
>
> > JREHOME=$JAVA_HOME/jre
> > JFCHOME=$JAVA_HOME/jfc
> > JRECP=$JREHOME/lib/rt.jar

>
> > CATALINA_HOME=/usr/share/tomcat6

>
> > export JAVA_HOME JDKHOME JREHOME JFCHOME JRECP CLASSPATH CATALINA_HOME

>
> > tomcat6.conf: -
> > JAVA_HOME="/opt/SDK/jdk"

>
> Why declare this both places?
>
> > # Where your tomcat installation lives
> > CATALINA_BASE="/usr/share/tomcat6"
> > CATALINA_HOME="/usr/share/tomcat6"

>
> Again, why declare it both places?
>
> > JASPER_HOME="/usr/share/tomcat6"
> > CATALINA_TMPDIR="/var/tmp/tomcat6"

>
> > The logs give no indication why it fails it just keeps saying that it
> > can't find a compiler.

>
> Probably because you haven't set up /usr/bin/java or else included
> $JAVA_HOME/bin in your PATH.
>
> In my Linux I've run:
>
> alternatives --install \
> /usr/java/java jdk /opt/java/jdk1.6.0_02 1600 \
> --slave /usr/java/jre jre /opt/java/jdk1.6.0_02/jre \
> --slave /usr/bin/java java /opt/java/jdk1.6.0_02/bin/java \
> --slave /usr/bin/rmiregistry rmiregistry \
> /opt/java/jdk1.6.0_02/bin/rmiregistry
>
> That ensures that "java" is in my path. You could extend that to include "javac".
>
> --
> Lew


Thank you all for your constructive comments.

It turns out after I tried all this and more, that there is a file in
the tomcat6 directory
/lib called jasper-jdt.jar that tells it to use the [standard] eclipse
jdt compiler,
This was *missing* from the rpm based installation I loaded. I loaded
the binary distro from apache and hey presto the sample jps compile,
and so does my (ha, ha) simple five minute jsp to test file upload
speeds.
I did r the fm, (http://tomcat.apache.org/tomcat-6.0-doc/jasper-
howto.html) but the relevant clue was on using alternative compilers
as there is NO default one. If this jar is missing, and there is no
ant jar, the tomcat install is simply unable to compile, and won't
tell you why.

I'll forward this message to the RPM packager.

Kevin.



 
Reply With Quote
 
Manish Pandit
Guest
Posts: n/a
 
      08-23-2007
On Aug 23, 8:09 am, muttley <ke...@mtel.co.uk> wrote:
>
> This was *missing* from the rpm based installation I loaded. I loaded
> the binary distro from apache and hey presto the sample jps compile,
> and so does my (ha, ha) simple five minute jsp to test file upload
> speeds.


Not sure if you're using Fedora, but if you are, I've found 'yum' as a
good alternative to downloading and installing rpms manually.

-cheers,
Manish

 
Reply With Quote
 
Martin Gregorie
Guest
Posts: n/a
 
      08-23-2007
Manish Pandit wrote:
>
> Not sure if you're using Fedora, but if you are, I've found 'yum' as a
> good alternative to downloading and installing rpms manually.
>

Indeed.

1) First try "yum list <package>". If that finds the package use
"yum install" to install it, otherwise its not supported by Fedora.

2)Next try http://rpmfind.net/ to see if ther's an RPM available for
Fedora. If so, download and install, repeating for any dependencies
it may have, preferably making sure that it gets installed in
/usr/local. It its put elsewhere you may want to uninstall and go to
step 3

3)Go to the package home and see what they offer and download the most
suitable form. If thats source tarballs compile them: if binaries,
unpack them. Install the binaries in /usr/local and put the config
files where directed, but use /usr/local/etc if you get the choice.


--
martin@ | Martin Gregorie
gregorie. | Essex, UK
org |
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compiler Error Message: The compiler failed with error code -1073741819 Ram ASP .Net 0 09-13-2005 09:52 AM
Why is a JIT compiler faster than a byte-compiler RickMuller Python 4 03-26-2005 04:30 PM
Compiler compiler with C++ as output Andrey Batyuck C++ 3 05-17-2004 08:17 PM
Can we use <compiler> tag to avoid RunTime Compiler error? Jack Wright ASP .Net 5 01-19-2004 04:36 PM
Compiler Error Message: The compiler failed with error code 128. Yan ASP .Net 0 07-21-2003 10:49 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57