Compiled byte code by Eclipse and JDK are different. Then how does the JVM understand both the byte codes? Example:
package com.hcl.raj.utilities;
public class StringTest {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
String name = "Rajkumar";
byte[] byteCodes = new byte[] {15,22,35,48};
String str1 = new String(byteCodes);
System.out.println(str1);
}
}
The compiled code of the above source code by JDK and Eclipse are different.
Original attempt to post compiled code removed due to encoding and formatting issues
Eclipse uses an SDK internally (which can be the same you used to directly generate your bytecode, or another one).
Also, different SDKs can generate different Bytecode (for example if the JDK is from a diferent company or a diferent version), but if they meet the bytecode specification when they generate bytecode, they will be well interpreted by a JVM that also follows that specification.