Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Convert class files in java code
Convert class files in java code [message #333676] Mon, 22 December 2008 20:28 Go to next message
Artur Zeiler is currently offline Artur ZeilerFriend
Messages: 10
Registered: July 2009
Junior Member
Hi all,

I use my own content assist and want to use methods in class files. Is
there a possibility to convert in eclise the binary code in java source
code?

Thanks!
Re: Convert class files in java code [message #333677 is a reply to message #333676] Tue, 23 December 2008 00:34 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Artur,

I'm pretty sure such a thing isn't built in. If you don't have the
source code for something (you can specify source attachments for jars),
you probably aren't meant to have it...


Artur Zeiler wrote:
> Hi all,
>
> I use my own content assist and want to use methods in class files. Is
> there a possibility to convert in eclise the binary code in java
> source code?
>
> Thanks!
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Convert class files in java code [message #333678 is a reply to message #333676] Tue, 23 December 2008 01:00 Go to previous messageGo to next message
Walter Harley is currently offline Walter HarleyFriend
Messages: 847
Registered: July 2009
Senior Member
Artur Zeiler wrote:
> Hi all,
>
> I use my own content assist and want to use methods in class files. Is
> there a possibility to convert in eclise the binary code in java
> source code?

You can try using a decompiler, such as JAD. There is a plug-in for
JAD, called JADClipse, that will let you view .class files as Java
source, with some limitations.

As Ed suggests, you need to be careful of licensing issues; it is not
always legal to decompile binaries.
Re: Convert class files in java code [message #333679 is a reply to message #333677] Tue, 23 December 2008 01:06 Go to previous messageGo to next message
Artur Zeiler is currently offline Artur ZeilerFriend
Messages: 10
Registered: July 2009
Junior Member
Sure that there is no way?
I tried it with
org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader, but i only get
the method names.
I can't find a way to get the method body.
Re: Convert class files in java code [message #333680 is a reply to message #333678] Tue, 23 December 2008 01:22 Go to previous messageGo to next message
Artur Zeiler is currently offline Artur ZeilerFriend
Messages: 10
Registered: July 2009
Junior Member
Thanks!
I'm workin on a project which should make it possible to reuse code that a
user already implemented. So there aren't problems with the license. I'm
searching for a way to get the source code without any decompiler. My
problem is, that i have to use eclipse for that, without any usage of
other tools.

Thanks!
Re: Convert class files in java code [message #333681 is a reply to message #333680] Tue, 23 December 2008 02:01 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Artur,

Making use of source attachments (a jar/zip file with all the
corresponding sources) is the way to go then.


Artur Zeiler wrote:
> Thanks!
> I'm workin on a project which should make it possible to reuse code
> that a user already implemented. So there aren't problems with the
> license. I'm searching for a way to get the source code without any
> decompiler. My problem is, that i have to use eclipse for that,
> without any usage of other tools.
>
> Thanks!
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:[JFace] bug in snippet 019
Next Topic:problem with the message: Cannot find 'org.junit.Test' on project build path
Goto Forum:
  


Current Time: Sat Apr 27 00:07:56 GMT 2024

Powered by FUDForum. Page generated in 0.04011 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top