Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can see the Scala Major/Minor version in the class file if you use <code>javap</code> with the verbose option. For example, the following is shown for a file compiled using scala 2.8.0 final:</p> <pre><code> javap -private -verbose T Compiled from "SomeTest.scala" public interface T SourceFile: "SomeTest.scala" ScalaSig: length = 0x3 05 00 00 RuntimeVisibleAnnotations: length = 0xB 00 01 00 06 00 01 00 07 73 00 08 minor version: 0 major version: 49 Constant pool: const #1 = Asciz SourceFile; const #2 = Asciz SomeTest.scala; const #3 = Asciz s; const #4 = Asciz ()Ljava/lang/String;; const #5 = Asciz ScalaSig; //etc etc... </code></pre> <p>while the following is the output of a file compiled using scala 2.7.7:</p> <pre><code> javap -verbose T2 Compiled from "SomeTest2.scala" public interface T2 SourceFile: "SomeTest2.scala" ScalaSig: length = 0x87 04 01 1B 06 08 01 02 FFFFFF84 FFFFFF90 FFFFFF80 FFFFFF91 00 05 02 02 54 32 0A 01 03 01 07 3C 65 6D 70 74 79 3E 03 00 13 02 00 06 10 02 07 0C 0D 01 08 0A 02 09 0A 01 04 6C 61 6E 67 0A 01 0B 01 04 6A 61 76 61 09 02 0D 08 02 06 4F 62 6A 65 63 74 08 05 0F 00 FFFFFF86 00 10 01 01 73 15 01 11 10 02 12 18 0E 02 13 16 0D 01 14 0A 01 15 01 05 73 63 61 6C 61 09 02 17 14 01 06 50 72 65 64 65 66 09 02 19 1A 02 06 53 74 72 69 6E 67 0A 02 17 14 minor version: 0 major version: 49 Constant pool: const #1 = Asciz SourceFile; const #2 = Asciz SomeTest2.scala; //etc etc... </code></pre> <p>The first two bytes of the ScalaSig constant entry should represent the scala Major/Minor version, I believe, which are defined in <a href="https://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/src/library/scala/reflect/generic/PickleFormat.scala" rel="noreferrer">PickleFormat</a>. The 2.7.7 version of PickleFormat can be found <a href="https://lampsvn.epfl.ch/trac/scala/browser/scala/tags/R_2_7_7_final/src/compiler/scala/tools/nsc/symtab/classfile/PickleFormat.scala" rel="noreferrer">here</a>, and shows that the major/minor version differs from the 2.8.0 version.</p> <p>I checked the 2.7.1 version of <a href="https://lampsvn.epfl.ch/trac/scala/browser/scala/tags/R_2_7_1_final/src/compiler/scala/tools/nsc/symtab/classfile/PickleFormat.scala" rel="noreferrer">this class</a> as well, but here the Major/Minor version is the same as the 2.7.7 one, so you may not be able to distinguish between minor scala versions by using this method.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload