- Open CLASS File
- Open CLASS File on Windows Operating System
- Open CLASS file article translations
- Формат файла CLASS — описание, как открыть?
- Чем открыть файл в формате CLASS
- Программы для открытия CLASS файлов
- Конвертация CLASS в другие форматы
- Почему именно CLASS и в чем его достоинства?
- How do I access and open a .class file [duplicate]
- 3 Answers 3
- How can I open Java .class files in a human-readable way?
- 17 Answers 17
- Not the answer you’re looking for? Browse other questions tagged java windows class applet or ask your own question.
- Linked
- Related
- Hot Network Questions
- Subscribe to RSS
Open CLASS File
CLASS file extension is used to denote a compiled Java source code file. Prior to compilation, Java files are stored in plaintext with the JAVA file extension. In order to run Java programs, the source code must be compiled to create a CLASS file, which can then be loaded into a Java Virtual Machine to execute the application. Many Java applications will make use of multiple classes, each of which is stored and loaded as an individual CLASS file.
Before executing an application written in Java, it must first be compiled. This process converts the plaintext source code of the application into bytecode, which is a set of instructions designed to be executed by a software interpreter, which in this case is the Java Virtual Machine (JVM). Unlike JAVA source files, CLASS files are not human-readable and you cannot open CLASS file using a text editor.
Java is a cross-platform compatible language, meaning that the bytecode produced by compiling a program on one platform will be able to run on the Java Virtual Machine of any other platform.
A CLASS file contains several separate sections including access flags, constants, classes, interfaces and methods. CLASS files are used by a Java program to create objects and define their behaviour. However, as CLASS files are run as part of an executable program, they should only be loaded into a JVM if they are from a known, trusted source as the program could potentially be malicious software.
You can open CLASS files, load and run on any platform which has a Java Virtual Machine. Alternatively, some CLASS files can be decompiled into their original, human-readable source code and opened with a standard text editor or development environment. However, in most cases the reverse engineering of compiled software is illegal, and whether or not decompiling the code for educational use is allowed will depend on the license and usage terms attached to the program.
Open CLASS File on Windows Operating System
- Find a CLASS file in question in Windows OS File Explorer and double click on it to launch the correpsonding application.
- If a CLASS file is not opened in an application and you instead get a «Windows can’t open a file» error message you should try looking for an application which can open the file in question.
- If you know the application which can open CLASS file then run it and see if there is a File->Open main menu option in the application.
- If you don’t know the application which can open CLASS file then try to search for «CLASS wiki», «application to open CLASS file» or «open CLASS file» queries in the search engine you like.
- Install the application you found and check if it can open CLASS file
Rate CLASS file page: 5 4 3 2 1 4 / 5 based on 26 ratings
Populating this website with information and maintaining it is an ongoing process. We always welcome feedback and questions that can be submitted by visiting Contact Us page. However since there are many users visiting this website and because our team is quite small we may not be able to follow up personally on every request. Thank you for your understanding.
Open CLASS file article translations
For more general information about how to open CLASS files, file extension class and registry you can read one of the following articles:
Windows registry — Windows registry is included in modern Windows operating systems to replace the older INI files which also contained system configuration. Let’s concentrate on the structure and purpose of Windows System Registry, review some possible attacks to it and ways to avoid them.
Folders, files and paths — Files are the entries or information stored on your computer. These are represented by binary coding and written on the tracks on a disk. Files are often represented by distinct icons, a normal practice done by Microsoft with their products including system files for their series of operating systems.
What are file extensions? — File extensions are unnoticed yet are very crucial parts of the computer world. But many are still unaware of the basic foundation and principles behind the remarkable wonders of computers.
Формат файла CLASS — описание, как открыть?
Файл формата CLASS открывается специальными программами. Чтобы открыть данный формат, скачайте одну из предложенных программ.
Чем открыть файл в формате CLASS
Расширение CLASS может быть представлено двумя основными исполнениями:
- Формат CLASS (разработчик Oracle) относится к категории файлов, скомпилированных при помощи Java. Активируется двоичный байт-код расширения CLASS при инициализации Java Virtual Machine (JVM). Зачастую данный формат поддерживает совместную работу с JAR файлами.
Выполняя команду javac, входящую в состав инсталляционного пакета JVM, можно получить расширение CLASS из Java-файлов. Некоторые интегрированные разновидности Java, например, Eclipse, поддерживают параллельную генерацию формата CLASS в процессе написания программного кода.
Ввиду того, что существует несколько модификаций JVM (включая версии 1.4-1.6), некоторые исполнения CLASS файлов могут не поддерживаться на определенных версиях JVM.
Отсутствие бинарного javac в комплексе Java Runtime Environment (JRE) не позволяет компилировать файлы CLASS, но не исключает возможности их фактического выполнения. JRE и JVM зачастую применяются как идентичные понятия, когда речь идет о платформе, запускающей Java приложения.
- Расширение CLASS представляет собой исходник к Gambas (правообладателем лицензии является GNU Public). Gambas – полнофункциональный, объектно-ориентированный язык программирования, выполненный на базе интерпретатора BASIC.
Методы и средства программирования, а также архитектура языка во многом схожа с представлением Java.
В основе Gambas следующие программные модули:
- компилятор;
- транслятор;
- архиватор;
- скрипты;
- рабочая программная область;
- дополнительные компоненты и конструктивные элементы.
Программы для открытия CLASS файлов
Если CLASS расширение представляет собой категорию файлов, скомпилированную при помощи Java, для генерации и воспроизведения его на базе ОС Windows можно воспользоваться самыми разнообразными программными комплексами:
В данном представлении CLASS адаптирован и для платформы ОС Mac:
Расширение может быть открыто и на базе ОС Linux с применением все тех же программных плагинов JD-GUI и Eclipse IDE for Java Developers with JD-Eclipse plug-in.
Если CLASS – исходник к Gambas, то открыть его можно с применением одной из версий языка программирования BASIC.
Если при открытии расширения CLASS возникает ошибка, причины могут заключаться в следующем:
- поврежден или инфицирован файл;
- файл не связан с реестром ОС (выбрано некорректное приложение для воспроизведения или не произведена инсталляция конкретного плагина);
- недостаточно ресурсов устройства или ОС;
- поврежденные или устаревшие драйвера.
Конвертация CLASS в другие форматы
Уникальная структура и область применения CLASS для каждого конкретного случая не предоставляют возможностей для конвертации данного формата в другие расширения. Попытки конвертации расширения в другой формат могут не только не дать никаких практических результатов, но и повредить исходный файл. В этой связи трансляция данного формата не практикуется.
Почему именно CLASS и в чем его достоинства?
CLASS расширения нельзя назвать широко распространенным и востребованным форматом среди обычных пользователей, однако он нашел свое применение в некоторых узкоспециализированных областях:
- поддержка специализированных компонентов, скомпилированных при помощи Java (разработчик Oracle);
- написание приложений на Gambas, являющимся полнофункциональным, объектно-ориентированным языком программирования (на базе интерпретатора BASIC).
Компилированный файл .JAVA, созданный компилятором Java. Содержит байтовый код являющийся бинарным программным кодом, выполняемым при запуске Java Virtual Machine (JVM). Обычно встраивается в файлы .JAR, которые входят в состав среды $CLASSPATH, подходящей для исполнения.
Файлы CLASS можно компилировать из файлов JAVA при помощи команды javac, входящей в состав пакета инсталляции JVM. Многие интегрированные среды разработки Java, такие как Eclipse, могут компилировать файлы CLASS на ходу, пока разработчики пишут программный код.
Поскольку существует множество версий JVM (например, 1.4, 1.5 и 1.6), некоторые файлы CLASS могут быть несовместимы с определенными версиями JVM. Java Runtime Environment (JRE) может выполнять файлы CLASS, но не может компилировать их, поскольку не включает в себя бинарный javac.
Примечание: компания Oracle приобрела Sun Microsystems — изначального разработчика Java. JRE и JVM часто используются как синонимы для ссылок на платформу, запускающую приложения Java.
Чем открыть файл в формате CLASS (Java Class File)
How do I access and open a .class file [duplicate]
How can I open a .class file in Windows 7? I am getting a message saying that I can’t see the file and that I have to choose a program to open it or look online for one. Is there any website, explanation, or download that will allow me to access ANY .class file I have extracted or have saved in my Documents?
3 Answers 3
Are you trying to decompile the .class file and view the source code? You can use Java Decompiler. It has a standalone GUI and also plugin for Eclipse/IntelliJ.
Is there any website, explanation, or download that will allow me to access ANY .class file I have extracted or have saved in my Documents?
It depends what you mean by «access» or «open». It also depends what you mean by extracting . and what you extracted them from.
If you are trying to run the class files, then the standard way to run a Java application is to use the java command, as documented on the Oracle website. For example: http://docs.oracle.com/javase/7/docs/technotes/tools/windows/java.html. But how you use it depends on the nature of the thing that you downloaded and / or extracted. (Some «.class» files are not applications. Some «.class» files are designed to be run without extracting them from their JAR file container.)
If you are trying to look at the code in the class files, you could use the javap command to disassemble it. Or you could use a third-party tool to decompile it. But unless you have a clue as to what you are doing, this is not likely to help much. And since I can’t really guess what you are trying to achieve, I can’t offer you any useful references.
If you are trying to do something else, you’ll need to explain what it is.
Either way, you need a Java installation on your machine before you can do anything.
How can I open Java .class files in a human-readable way?
I’m trying to figure out what a Java applet’s class file is doing under the hood. Opening it up with Notepad or Textpad just shows a bunch of gobbledy-gook.
Is there any way to wrangle it back into a somewhat-readable format so I can try to figure out what it’s doing?
- Environment == Windows w/ VS 2008 installed.
17 Answers 17
jd-gui is the best decompiler at the moment. it can handle newer features in Java, as compared to the getting-dusty JAD.
If you don’t mind reading bytecode, javap should work fine. It’s part of the standard JDK installation.
As pointed out by @MichaelMyers, use
to get the JVM assembly code. You may also redirect the output to a text file for better visibility.
You want a java decompiler, you can use the command line tool javap to do this. Also, Java Decompiler HOW-TO describes how you can decompile a class file.
what you are looking for is a java de-compiler. I recommend JAD http://www.kpdus.com/jad.html It’s free for non commercial use and gets the job done.
Note: this isn’t going to make the code exactly the same as what was written. i.e. you’re going to lose comments and possibly variable names, so it’s going to be a little bit harder than just reading normal source code. If the developer is really secretive they will have obfuscated their code as well, making it even harder to read.
cpuguru, if your applet has been compiled with javac 1.3 (or less), your best option is to use Jad.
Unfortunately, the last JDK supported by JAD 1.5.8 (Apr 14, 2001) is JDK 1.3.
If your applet has been compiled with a more recent compiler, you could try JD-GUI : this decompiler is under development, nevertheless, it generates correct Java sources, most of time, for classes compiled with the JDKs 1.4, 1.5 or 1.6.
DarenW, thank you for your post. JD-GUI is not the best decompiler yet . but I’m working on 🙂
Using Jad to decompile it is probably your best option. Unless the code has been obfuscated, it will produce an okay result.
That’s compiled code, you’ll need to use a decompiler like JAD: http://www.kpdus.com/jad.html
You need to use a decompiler. Others have suggested JAD, there are other options, JAD is the best.
I’ll echo the comments that you may lose a bit compared to the original source code. It is going to look especially funny if the code used generics, due to erasure.
JAD and/or JADclipse Eclipse plugin, for sure.
If the class file you want to look into is open source, you should not decompile it, but instead attach the source files directly into your IDE. that way, you can just view the code of some library class as if it were your own
you can also use the online java decompilers available. For e.g. http://www.javadecompilers.com
As suggested you can use JAD to decompile it and view the files. To make it easier to read you can use the JADclipse plugin for eclipse to integrate JAD directly to eclipse or use DJ Java Decompiler which is much easier to use than command line JAD
JAD is an excellent option if you want readable Java code as a result. If you really want to dig into the internals of the .class file format though, you’re going to want javap . It’s bundled with the JDK and allows you to «decompile» the hexadecimal bytecode into readable ASCII. The language it produces is still bytecode (not anything like Java), but it’s fairly readable and extremely instructive.
Also, if you really want to, you can open up any .class file in a hex editor and read the bytecode directly. The result is identical to using javap .
There is no need to decompile Applet.class. The public Java API classes sourcecode comes with the JDK (if you choose to install it), and is better readable than decompiled bytecode. You can find compressed in src.zip (located in your JDK installation folder).
CFR — another java decompiler is a great decompiler for modern Java written i Java 6.
Not the answer you’re looking for? Browse other questions tagged java windows class applet or ask your own question.
Linked
Related
Hot Network Questions
Subscribe to RSS
To subscribe to this RSS feed, copy and paste this URL into your RSS reader.
site design / logo © 2021 Stack Exchange Inc; user contributions licensed under cc by-sa. rev 2021.4.16.39093
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.