Giter VIP home page Giter VIP logo

jbc's Introduction

JBC

Build Status

JBC is an eclipse plugin that enables the developer to view and edit files containing java byte code (*.class) inside eclipse. This is done in a way such that a specialized editor opens the .class file and displays the binary code as a textual DSL whereas keywords intersparse the byte sequences. Changing the text and saving then writes back the bytes to the .class file.

Installation

To install the editor you have to add the following update site to eclipse:

http://download.itemis.com/jbc/updates/

You can do so by going through the main menu under "Help->Install New Software...", click an "Add..." and insert the URL in the dialog. You can then install the feature "JBC / JBC Feature".

There is also an entry in the eclipse marketplace:

http://marketplace.eclipse.org/content/jbc/

Usage

To support the developer the outline displays and interpretation of the byte code with resolved references. There is validation and quick fixes for table sizes as well as quick navigation (F3) to referenced elements, autocompletion, hover information and some more.

JBC Editor

One can open the .class file for a java file from the Project or Package Explorer by executing the context menu action "Open JBC". The opened class file can be viewed and editor. But of course, if you modify your java file, the class file will be overridden. This is mostly intended to help you understand what your source code is transformed to by the compiler.

Open .class from .java

It is also possible to open a .class file directly from the Project or Package Explorer by opening it with the "JBC Editor". It is not necessary that the class file is inside a java project, it just needs to be in the workspace. You can, for example, extract some jar, modify the included .class files and write them back to the jar. This way you can modify existing jars without having the source available.

Open .class directly

External Links

  • Introductional article: 4+1 = CAFEBABE: Java Bytecode in Eclipse (english / german)
  • Some technical background: Xtext-Editor für binäre Dateien (german)

jbc's People

Contributors

arnedeutsch avatar prggz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jbc's Issues

Composite update site with JBC and XText

To give smoother installation #2 and enable straight-forward install with MPC #4
there should be 1 update site to install JBC and XText

If XText version depends on Eclipse platform version, than several such update sites would be needed.
Marketplace support specifying and using different URL for different Eclipse version

Java 9 .class error (BasicIndexOutOfBoundsException)

Hello Sr,
I really enjoy your Eclipse Plugin, but I'm having this error opening a compiled java 9 .cass

org.eclipse.emf.common.util.BasicEList$BasicIndexOutOfBoundsException: index=201, size=201 at org.eclipse.emf.common.util.BasicEList.get(BasicEList.java:346) at com.itemis.jbc.binary.ClassFileAccessAPI.instructionFromOffset(ClassFileAccessAPI.java:716) at com.itemis.jbc.binary.ByteCodeReader.readCodeTableEntryRef(ByteCodeReader.java:973) at com.itemis.jbc.binary.ByteCodeReader.readExceptionTableEntry(ByteCodeReader.java:496) at com.itemis.jbc.binary.ByteCodeReader.readExceptionTable(ByteCodeReader.java:488) at com.itemis.jbc.binary.ByteCodeReader.readCodeAttribute(ByteCodeReader.java:479) at com.itemis.jbc.binary.ByteCodeReader.readAttribute(ByteCodeReader.java:413) at com.itemis.jbc.binary.ByteCodeReader.readAttributes(ByteCodeReader.java:396) at com.itemis.jbc.binary.ByteCodeReader.readMethod(ByteCodeReader.java:389) at com.itemis.jbc.binary.ByteCodeReader.readMethods(ByteCodeReader.java:378) at com.itemis.jbc.binary.ByteCodeReader.readClassFile(ByteCodeReader.java:128) at com.itemis.jbc.binary.ByteCodeReader.fromDataInputStream(ByteCodeReader.java:99) at com.itemis.jbc.binary.ByteCodeReader.fromByteArray(ByteCodeReader.java:95) at com.itemis.jbc.ui.custom.JBCInputStreamContentReader.readContentFromClassFile(JBCInputStreamContentReader.java:112) at com.itemis.jbc.ui.custom.JBCInputStreamContentReader.readContent(JBCInputStreamContentReader.java:29) at com.itemis.jbc.ui.custom.JBCDocumentProvider.setDocumentContent(JBCDocumentProvider.java:23) at org.eclipse.ui.editors.text.FileDocumentProvider.setDocumentContent(FileDocumentProvider.java:406) at org.eclipse.xtext.ui.editor.model.XtextDocumentProvider.setDocumentContent(XtextDocumentProvider.java:191) at org.eclipse.ui.editors.text.StorageDocumentProvider.createDocument(StorageDocumentProvider.java:225) at org.eclipse.xtext.ui.editor.model.XtextDocumentProvider.createDocument(XtextDocumentProvider.java:149) at org.eclipse.ui.editors.text.FileDocumentProvider.createElementInfo(FileDocumentProvider.java:691) at org.eclipse.xtext.ui.editor.model.XtextDocumentProvider.createElementInfo(XtextDocumentProvider.java:270) at org.eclipse.ui.texteditor.AbstractDocumentProvider.connect(AbstractDocumentProvider.java:395) at org.eclipse.ui.texteditor.AbstractTextEditor.doSetInput(AbstractTextEditor.java:4212) at org.eclipse.ui.texteditor.StatusTextEditor.doSetInput(StatusTextEditor.java:260) at org.eclipse.ui.texteditor.AbstractDecoratedTextEditor.doSetInput(AbstractDecoratedTextEditor.java:1478) at org.eclipse.ui.editors.text.TextEditor.doSetInput(TextEditor.java:153) at org.eclipse.xtext.ui.editor.XtextEditor.doSetInput(XtextEditor.java:259) at com.itemis.jbc.ui.custom.JBCEditor.doSetInput(JBCEditor.java:34) at org.eclipse.ui.texteditor.AbstractTextEditor.lambda$1(AbstractTextEditor.java:3179) at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:436) at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:352) at org.eclipse.ui.internal.WorkbenchWindow.lambda$5(WorkbenchWindow.java:2368) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:72) at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:2366) at org.eclipse.ui.texteditor.AbstractTextEditor.internalInit(AbstractTextEditor.java:3196) at org.eclipse.ui.texteditor.AbstractTextEditor.init(AbstractTextEditor.java:3221) at org.eclipse.xtext.ui.editor.XtextEditor.init(XtextEditor.java:305) at org.eclipse.ui.internal.EditorReference.initialize(EditorReference.java:353) at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:340) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58) at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:998) at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:963) at org.eclipse.e4.core.internal.di.InjectorImpl.internalInject(InjectorImpl.java:139) at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:408) at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:331) at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:202) at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:91) at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:60) at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:42) at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.createWidget(ContributedPartRenderer.java:132) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:1002) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:662) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:768) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$0(PartRenderingEngine.java:739) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:733) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:717) at org.eclipse.e4.ui.internal.workbench.PartServiceImpl$1.handleEvent(PartServiceImpl.java:107) at org.eclipse.e4.ui.services.internal.events.UIEventHandler.lambda$0(UIEventHandler.java:38) at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:236) at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:146) at org.eclipse.swt.widgets.Display.syncExec(Display.java:5728) at org.eclipse.e4.ui.internal.workbench.swt.E4Application$1.syncExec(E4Application.java:219) at org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:38) at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:205) at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:203) at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1) at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234) at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:151) at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:132) at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:75) at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:44) at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:55) at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:63) at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:424) at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElementGen(ElementContainerImpl.java:170) at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElement(ElementContainerImpl.java:188) at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.showElementInWindow(ModelServiceImpl.java:651) at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.bringToTop(ModelServiceImpl.java:615) at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.delegateBringToTop(PartServiceImpl.java:790) at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.bringToTop(PartServiceImpl.java:404) at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.showPart(PartServiceImpl.java:1239) at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:3205) at org.eclipse.ui.internal.WorkbenchPage.lambda$9(WorkbenchPage.java:3110) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:72) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:3108) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:3078) at org.eclipse.ui.actions.OpenWithMenu.openEditor(OpenWithMenu.java:326) at org.eclipse.ui.actions.OpenWithMenu.lambda$0(OpenWithMenu.java:183) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5618) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1405) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4882) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4406) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1160) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1049) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155) at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:633) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:557) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:150) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:660) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:597) at org.eclipse.equinox.launcher.Main.run(Main.java:1468) at org.eclipse.equinox.launcher.Main.main(Main.java:1441)

Can you please take a look?

Thanks

Updating the Xtext Community Website

Hello JBC team,

The Xtext team would like to update the Xtext community website listing all the cool projects people are building around Xtext/Xtend.

See also the corresponding GitHub issue and Bugzilla ticket.

If you are interested that the JBC project is listed there, please provide the following information as a comment to this issue:

<tr>
	<td><a href="project_link">project_name</a></td>
	<td>project_description_max_2_sentences</td>
	<td>license</td>
	<td>category</td>
	<td>author(s)</td>
</tr>

We will then update the Xtext community website and get it online as soon as possible.

Thanks!
Tamás

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.