<div dir="ltr"><div><div>Hmm, the code that decides which java to use when -j isn't set is really simple:<br><br>JVM=$( which java || true )<br><br></div>It doesn't seem like anything could possibly go wrong, but i've been able to replicate the problem on the mcs login hosts. I'll investigate.<br>
<br></div>- Tim<br><div><div><br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Apr 28, 2014 at 3:21 PM, Ketan Maheshwari <span dir="ltr"><<a href="mailto:ketan@mcs.anl.gov" target="_blank">ketan@mcs.anl.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">It shows the following:<div>declare -x PATH="/homes/ketan/cloud/ec2-api-tools-1.6.12.2/bin:/homes/ketan/apache-maven-3.2.1/bin:/homes/ketan/jdk1.7.0_07/bin:/homes/ketan/globus-install/bin:/homes/ketan/swift-0.94/cog/modules/swift/dist/swift-svn/bin:/homes/ketan/escience_2013/swift:/home/ketan/CoinIpopt/bin:/homes/ketan/cctools-install/bin:/home/neosotc/neos-bin:/home/ketan/tcl-install/bin:/home/ketan/mpich3-install/bin:/home/ketan/exm-install/turbine/bin:/home/ketan/exm-install/stc/bin:/homes/ketan/swig-install/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/mcs/bin:/usr/local/bin:/software/common/bin:/soft/apps/bin:/soft/gnu/bin:/soft/com/bin:/soft/adm/bin:/homes/ketan/bin/linux-Ubuntu_12.04-x86_64:/homes/ketan/bin"<br>
</div><div><br></div><div>It does have both /usr/bin and /homes/ketan/jdk1.7.0_07/bin and seems /homes/ketan/jdk1.7.0_07/bin appears before /usr/bin which makes /homes/ketan/jdk1.7.0_07/bin appear as default java.</div></div>
<div class="gmail_extra"><br><br><div class="gmail_quote"><div class="">On Mon, Apr 28, 2014 at 3:16 PM, Tim Armstrong <span dir="ltr"><<a href="mailto:tim.g.armstrong@gmail.com" target="_blank">tim.g.armstrong@gmail.com</a>></span> wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div class="">
<div dir="ltr">Can you check that the PATH is exported, e.g:<br>
<br>
export | grep PATH<br>
</div></div><div><div class="h5"><div><div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Mon, Apr 28, 2014 at 2:25 PM, Ketan Maheshwari <span dir="ltr">
<<a href="mailto:ketan@mcs.anl.gov" target="_blank">ketan@mcs.anl.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Strange:
<div><br>
</div>
<div>
<div>$ stc -v</div>
<div>STC: Swift-Turbine Compiler</div>
<div><span style="white-space:pre-wrap"></span>for Turbine: 0.3.0</div>
<div>TURBINE_INSTALL=</div>
<div>TURBINE_HOME=/home/ketan/exm-install/turbine</div>
<div>Using Java: /usr/bin/java</div>
<div>$ which java</div>
<div>/homes/ketan/jdk1.7.0_07/bin/java</div>
</div>
<div><br>
</div>
<div><br>
</div>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">
<div>On Mon, Apr 28, 2014 at 2:11 PM, Tim Armstrong <span dir="ltr"><<a href="mailto:tim.g.armstrong@gmail.com" target="_blank">tim.g.armstrong@gmail.com</a>></span> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div dir="ltr">
<div>
<div>Hmm, the code to locate java is really simple, it does a "which java" and that's all. Is your path variable being exported after you add Java to it?<br>
<br>
You can get stc to report which java it's using with the lower case -v flag too.<span><font color="#888888"><br>
<br>
</font></span></div>
</div>
<span><font color="#888888">
<div>- Tim<br>
</div>
</font></span></div>
<div>
<div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">
<div>On Mon, Apr 28, 2014 at 12:58 PM, Ketan Maheshwari <span dir="ltr">
<<a href="mailto:ketan@mcs.anl.gov" target="_blank">ketan@mcs.anl.gov</a>></span> wrote:<br>
</div>
<div>
<div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">It appears so. I have my own java in PATH and am using the same for building and running.</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">
<div>On Mon, Apr 28, 2014 at 11:15 AM, Tim Armstrong <span dir="ltr"><<a href="mailto:tim.g.armstrong@gmail.com" target="_blank">tim.g.armstrong@gmail.com</a>></span> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div dir="ltr">
<div>
<div>
<div>It should default to the java in PATH - is it not doing that for you? <br>
<br>
</div>
Currently it only uses two things to resolve java: the -j flag, and "which java" - other environment variables, etc, shouldn't affect it.<span><font color="#888888"><br>
<br>
</font></span></div>
</div>
<span><font color="#888888">- Tim<br>
</font></span></div>
<div>
<div>
<div>
<div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Mon, Apr 28, 2014 at 11:04 AM, Ketan Maheshwari <span dir="ltr">
<<a href="mailto:ketan@mcs.anl.gov" target="_blank">ketan@mcs.anl.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Hi Tim,
<div><br>
</div>
<div>stc -V does not seem to show which java it is running with:</div>
<div><br>
</div>
<div>
<div>$ stc -V user.swift</div>
<div>stc: Optimization level 2</div>
<div>
<div>Exception in thread "main" java.lang.UnsupportedClassVersionError: exm/stc/ui/Main : Unsupported major.minor version 51.0</div>
</div>
</div>
<div><br>
</div>
<div>The -j option works but in my case, the stc call is part of a generic script and this will involve detecting java on systems to run with. Is it somehow possible to tell stc to use the same java in current env at the time of build and run.</div>
<div><br>
</div>
<div>Thanks,</div>
<div>Ketan</div>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">
<div>On Mon, Apr 28, 2014 at 10:56 AM, Tim Armstrong <span dir="ltr"><<a href="mailto:tim.g.armstrong@gmail.com" target="_blank">tim.g.armstrong@gmail.com</a>></span> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div>
<div dir="ltr">
<div>
<div>I haven't seen that one before. It sounds like it's being run with an older version of Java than it was compiled with.<br>
<br>
Java class version 51.0 corresponds to java 7 (<a href="http://en.wikipedia.org/wiki/Java_class_file#General_layout" target="_blank">http://en.wikipedia.org/wiki/Java_class_file#General_layout</a>), so it seems like it must be getting run with an older version.<br>
<br>
</div>
You could try the -V switch to STC to see which java it's being run with, and then -j /path/to/jvm/bin/java to force a different java version.<br>
<br>
</div>
- Tim<br>
</div>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">
<div>
<div>
<div>On Mon, Apr 28, 2014 at 10:33 AM, Ketan Maheshwari <span dir="ltr"><<a href="mailto:ketan@mcs.anl.gov" target="_blank">ketan@mcs.anl.gov</a>></span> wrote:<br>
</div>
</div>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div>
<div>
<div>
<div dir="ltr">Hi,
<div><br>
</div>
<div>While running stc on MCS workstations, I get:</div>
<div><br>
</div>
<div>./genleaf vanilla mockdock.c mockdock.h user.swift<br>
</div>
<div>Exception in thread "main" java.lang.UnsupportedClassVersionError: exm/stc/ui/Main : Unsupported major.minor version 51.0<br>
</div>
<div><br>
</div>
<div>Somehow the java versions at build and runtime are getting mixed up.</div>
<div><br>
</div>
<div>This is how I build:</div>
<div><br>
</div>
<div>export JAVA_HOME=/homes/ketan/jdk1.7.0_07<br>
</div>
<div>ant install -Ddist.dir=/home/ketan/exm-install/stc<br>
</div>
<div><br>
</div>
<div>I have the same java in my env:</div>
<div><br>
</div>
<div>
<div>$ which java</div>
<div>/homes/ketan/jdk1.7.0_07/bin/java</div>
</div>
<div><br>
</div>
<div><br>
</div>
<div>Any suggestions to fix this?</div>
<div><br>
</div>
<div>Thanks,</div>
<div>Ketan</div>
</div>
<br>
</div>
</div>
</div>
</div>
<div>_______________________________________________<br>
ExM-user mailing list<br>
<a href="mailto:ExM-user@lists.mcs.anl.gov" target="_blank">ExM-user@lists.mcs.anl.gov</a><br>
<a href="https://lists.mcs.anl.gov/mailman/listinfo/exm-user" target="_blank">https://lists.mcs.anl.gov/mailman/listinfo/exm-user</a><br>
<br>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</blockquote>
</div>
</div>
</div>
<br>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</blockquote>
</div>
<br>
</div>
</div></div></div></div></div>
</blockquote></div><br></div>
</blockquote></div><br></div>