[ 
https://issues.apache.org/jira/browse/THRIFT-1787?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14255235#comment-14255235
 ] 

Jens Geyer edited comment on THRIFT-1787 at 12/21/14 6:21 PM:
--------------------------------------------------------------

I think, I can reproduce this, and I found the root cause. It is related to the 
issue mentioned at 
http://lists.gnu.org/archive/html/autoconf/2011-10/msg00000.html and I 
eventually came up with the reason because after checking the usual suspects 
like {{CLASSPATH}} and the like I finally wondered whether it might have 
something to do with the fact that Java emits english error messages during 
configure, but german messages otherwise.

In short, the JVM fails to locate the *.class file within an path that contains 
(e.g.) Umlauts, such as in {{~/Arbeitsfläche/Thrift}} because of {{LC_ALL=C}} 
being set by configure. The symptom is, that 

{code}
java configtest_ax_javac_and_java
{code}

works fine when invoked by hand, but configure fails at exactly that step, even 
with an explictly set classpath {{-cp .}} with the message:

{code:title=config.log}
Running "/usr/bin/javac configtest_ax_javac_and_java.java"
Running "/usr/bin/java configtest_ax_javac_and_java"
Error: Could not find or load main class configtest_ax_javac_and_java
{code}

Temporarily adding {{LC_ALL=}} right before the Java check solves the issue. 
The other workaround is to use a path using only {{LC_ALL=C}}-compatible 
characters.

*Question*: 
Is there something we could/should change in the config scripts to avoid this 
annoying issue? It is quite hard to track down and it cost me at least two 
hours to find it.





was (Author: jensg):

I think, I can reproduce this, and I found the root cause. It is related to the 
issue mentioned at 
http://lists.gnu.org/archive/html/autoconf/2011-10/msg00000.html and I 
eventually came up with the reason because after checking the usual suspects 
like {{CLASSPATH}} and the like I finally wondered whether it might have 
something to do with the fact that Java emits english error messages during 
configure, but german messages otherwise.

In short, the JVM fails to locate the *.class file within an path that contains 
(e.g.) Umlauts, such as in {{~/Arbeitsfläche/Thrift}} because of {{LC_ALL=C}} 
being set by configure. The symptom is, that 

{code}
java configtest_ax_javac_and_java
{code}

works fine when invoked by hand, but configure fails at exactly that step, even 
with an explictly set classpath {{-cp .}} with the message:

{code:title=config.log}
Running "/usr/bin/javac configtest_ax_javac_and_java.java"
Running "/usr/bin/java configtest_ax_javac_and_java"
Error: Could not find or load main class configtest_ax_javac_and_java
{code}

Temporarily adding {{LC_ALL=}} right before the Java check solves the issue. 
The other workaround is to use a path using only {{LC_ALL=}}-compatible 
characters.

*Question*: 
Is there something we could/should change in the config scripts to avoid this 
annoying issue? It is quite hard to track down and it cost me at least two 
hours to find it.




> Thrift compiling Java Problem
> -----------------------------
>
>                 Key: THRIFT-1787
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1787
>             Project: Thrift
>          Issue Type: Bug
>    Affects Versions: 0.8, 0.9
>         Environment: Linux Ubuntu 12.04 LTS
>            Reporter: Tarik Yilmaz
>              Labels: building, compile, java, library, thrift
>         Attachments: terminal-output.txt
>
>
> Thrift compile problem...
> ----- config.log ----
> ....
> configure:16768: checking for javac and java
> Running "javac configtest_ax_javac_and_java.java"
> Running "java configtest_ax_javac_and_java"
> Error: Could not find or load main class configtest_ax_javac_and_java
> ....
> -- $ ./configure -----
> ...
> checking for javac and java... no
> checking for ant... no
> checking for ant version > 1.7... expr: syntax error
> no
> ....
> -- $ java -version ---
> java version "1.7.0_09"
> Java(TM) SE Runtime Environment (build 1.7.0_09-b05)
> Java HotSpot(TM) Server VM (build 23.5-b02, mixed mode)
> -- $ javac -version --
> javac 1.7.0_09
> -- $ echo $JAVA_HOME --
> /usr/lib/jvm/jdk1.7.0
> -- $ echo $CLASSPATH --
> /usr/lib/jvm/jdk1.7.0/lib:/usr/lib/jvm/jdk1.7.0/jre/lib:.
> Ubuntu 12.04 32bit Oracle Java from Source Code



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to