[ExM Users] stc unsupported class error

Tim Armstrong tim.g.armstrong at gmail.com
Mon Apr 28 14:11:42 CDT 2014


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?

You can get stc to report which java it's using with the lower case -v flag
too.

- Tim


On Mon, Apr 28, 2014 at 12:58 PM, Ketan Maheshwari <ketan at mcs.anl.gov>wrote:

> It appears so. I have my own java in PATH and am using the same for
> building and running.
>
>
> On Mon, Apr 28, 2014 at 11:15 AM, Tim Armstrong <tim.g.armstrong at gmail.com
> > wrote:
>
>>   It should default to the java in PATH - is it not doing that for you?
>>
>>  Currently it only uses two things to resolve java: the -j flag, and
>> "which java" - other environment variables, etc, shouldn't affect it.
>>
>>  - Tim
>>
>>
>> On Mon, Apr 28, 2014 at 11:04 AM, Ketan Maheshwari <ketan at mcs.anl.gov>wrote:
>>
>>> Hi Tim,
>>>
>>>  stc -V does not seem to show which java it is running with:
>>>
>>>  $ stc -V user.swift
>>> stc: Optimization level 2
>>>  Exception in thread "main" java.lang.UnsupportedClassVersionError:
>>> exm/stc/ui/Main : Unsupported major.minor version 51.0
>>>
>>>  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.
>>>
>>>  Thanks,
>>> Ketan
>>>
>>>
>>>  On Mon, Apr 28, 2014 at 10:56 AM, Tim Armstrong <
>>> tim.g.armstrong at gmail.com> wrote:
>>>
>>>>   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.
>>>>
>>>> Java class version 51.0 corresponds to java 7 (
>>>> http://en.wikipedia.org/wiki/Java_class_file#General_layout), so it
>>>> seems like it must be getting run with an older version.
>>>>
>>>>  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.
>>>>
>>>>  - Tim
>>>>
>>>>
>>>>   On Mon, Apr 28, 2014 at 10:33 AM, Ketan Maheshwari <ketan at mcs.anl.gov
>>>> > wrote:
>>>>
>>>>>   Hi,
>>>>>
>>>>>  While running stc on MCS workstations, I get:
>>>>>
>>>>>  ./genleaf vanilla mockdock.c mockdock.h user.swift
>>>>>  Exception in thread "main" java.lang.UnsupportedClassVersionError:
>>>>> exm/stc/ui/Main : Unsupported major.minor version 51.0
>>>>>
>>>>>  Somehow the java versions at build and runtime are getting mixed up.
>>>>>
>>>>>  This is how I build:
>>>>>
>>>>>  export JAVA_HOME=/homes/ketan/jdk1.7.0_07
>>>>>  ant install -Ddist.dir=/home/ketan/exm-install/stc
>>>>>
>>>>>  I have the same java in my env:
>>>>>
>>>>>  $ which java
>>>>> /homes/ketan/jdk1.7.0_07/bin/java
>>>>>
>>>>>
>>>>>  Any suggestions to fix this?
>>>>>
>>>>>  Thanks,
>>>>> Ketan
>>>>>
>>>>>   _______________________________________________
>>>>> ExM-user mailing list
>>>>> ExM-user at lists.mcs.anl.gov
>>>>> https://lists.mcs.anl.gov/mailman/listinfo/exm-user
>>>>>
>>>>>
>>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/exm-user/attachments/20140428/b6c0bc3e/attachment.html>


More information about the ExM-user mailing list