473,396 Members | 1,965 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to determine Java bytecode version

Howdy,

I'm trying to figure out what bytecode version a given class was
compiled with. I've tried looking at the actual .class file, but that
didn't pan out.

Is there a utility to determine versions?

thanks!

Sam
Jul 17 '05 #1
1 18006

"Samuel Jackson" <sa**********@hotmail.com> wrote in message
news:22**************************@posting.google.c om...
Howdy,

I'm trying to figure out what bytecode version a given class was
compiled with. I've tried looking at the actual .class file, but that
didn't pan out.

Is there a utility to determine versions?


Every '.class' file starts off with the following:

* Magic Number [4 bytes]
* Version Information [4 bytes]

A hexdump of a '.class' file compiled with each of the following options
reveals:

javac -target 1.1 ==> CA FE BA BE 00 03 00 2D
javac -target 1.2 ==> CA FE BA BE 00 00 00 2E
javac -target 1.3 ==> CA FE BA BE 00 00 00 2F
javac -target 1.4 ==> CA FE BA BE 00 00 00 30

Perhaps you could use this information to write your own '.class' file
version checking utility, using Java, or perhaps a scripting or shell
language ;) !

I hope this helps.

Anthony Borla

P.S.

If requiring more information just do a Google search for ".class file
format" or "Java Bytecode Tutorial"
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: John Doe | last post by:
Hello, I'm currently working on a little tool that would benefit from having a little embedded script language. Although I have C++ source code available for such a script language, I have 2...
4
by: angel | last post by:
A java runtime environment includes jvm and java class (for example classes.zip in sun jre). Of course jython need jvm,but does it need java class. Thanx
289
by: napi | last post by:
I think you would agree with me that a C compiler that directly produces Java Byte Code to be run on any JVM is something that is missing to software programmers so far. With such a tool one could...
12
by: john_sips_tea | last post by:
I've got a fairly substantial webapp written in Java (plus Tomcat, Hibernate, Struts, JSP, MySQL) that is a bit of a bear to work with. I didn't write it. Much of it is only very sparsely...
4
by: Jean-François Blais | last post by:
Many must have asked that question. I intend to write a few programs which will be CPU intensive. I know a little of Java. Would a language that yields native code, instead of bytecode perfrom much...
29
by: walterbyrd | last post by:
Some think it will. Up untill now, Java has never been standard across different versions of Linux and Unix. Some think that is one reason that some developers have avoided Java in favor of...
3
blazedaces
by: blazedaces | last post by:
I was working all day yesterday (and will probably be for most of today) with bytecode where java wrote the bytecode and matlab read it... I had never worked with bytecode in great detail before so...
5
by: r035198x | last post by:
Setting up. Getting started To get started with java, one must download and install a version of Sun's JDK (Java Development Kit). The newest release at the time of writting this article is...
63
by: s0suk3 | last post by:
I've been programming Python for a couple of years now. Now I'm looking to move on to either C++ or Java, but I'm not sure which. Which one do you think will be a better transition for a Python...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.