title: Switching between bytecode versions for a Java class file
body: <p>Given a Java class file (ClassName.class) with bytecode version X is there a general way to convert this class file from being represented in bytecode version X to being represented in bytecode version Y?</p>
  
  <p>Assumptions:</p>
  
  <ul>
  <li>The source code is not available. The class file is the only available representation of the class.</li>
  <li>The class file is heavily obfuscated, so decompiling the class with say jad or similar program and then recompiling it with "-target ..." does not work.</li>
  </ul>
  
  <p>Updates after initial post:</p>
  
  <ul>
  <li>Update #1: Futhermore, assume that bytecode version X and bytecode version Y are sufficiently close so that all instructions used by the class (currently in bytecode version X) also exists in version Y.</li>
  </ul>