title: bad class cafebabe or version 0034
body: <p>After reading other similar questions, I still couldn't find a solution for this. I get the following stack trace which complains about a jar containing a library that I developed, compiled with Java 1.7:</p>
  
  <pre><code>UNEXPECTED TOP-LEVEL EXCEPTION:
  com.android.dx.cf.iface.ParseException: bad class file magic (cafebabe) or version (0034.0000)
  at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:472)
  at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406)
  at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388)
  at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251)
  at com.android.dx.command.dexer.Main.processClass(Main.java:704)
  at com.android.dx.command.dexer.Main.processFileBytes(Main.java:673)
  at com.android.dx.command.dexer.Main.access$300(Main.java:83)
  at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:602)
  at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
  at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
  at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
  at com.android.dx.command.dexer.Main.processOne(Main.java:632)
  at com.android.dx.command.dexer.Main.processAllFiles(Main.java:510)
  at com.android.dx.command.dexer.Main.runMonoDex(Main.java:280)
  at com.android.dx.command.dexer.Main.run(Main.java:246)
  at com.android.dx.command.dexer.Main.main(Main.java:215)
  at com.android.dx.command.Main.main(Main.java:106)
  ...while parsing build/classes/main/com/utils/helpers/DateTimeAdapter.class
  </code></pre>
  
  <p>I have the compiler level set to java 7 both in Android Studio and Eclipse and adding sourceCompatibility and targetCompatibility in the build.gradle file did not solve this problem. The path to the JDK is also correctly set in both IDE's.</p>
  
  <p>I found out that 0034 is hexadecimal for Java 8, but it's not even installed in my machine.</p>
  
  <p>I also tried editing proguard.bat, suggested in this <a href="https://stackoverflow.com/questions/7866723/dx-bad-class-file-magic-cafebabe-or-version-0033-0000-with-adk14">thread</a>, with no luck.</p>
  
  <p>Does anyone have any thoughts on this?</p>