DZone Forums
Go Back   DZone Forums > Community > Tools & IDEs > Eclipse
Reload this Page How to get location of .class file in package explorer
Notices
Reply
 
LinkBack Thread Tools Display Modes
  (#1 (permalink)) Old
Member
 
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Oct 2009
Default How to get location of .class file in package explorer - 10-27-2009, 01:33 AM

Hi,

i developed a small GUI in Eclipse. if i have a java file opened in the editor,i want to get the location of .class file for the active java file.

For eg: If i opened a file called "Test.java" in editor, i want its full path such as "C:\TestPrj\bin\Test.class". I searched in Eclispe Api's, but i cannot get one.

Help me plz.
Reply With Quote
  (#2 (permalink)) Old
Member
 
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Aug 2009
Default 11-03-2009, 03:40 AM

If you get an IResource, you should try
res.getLocation().toFile().getAbsolutePath()

Regards,
Benoit
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Add item to right click in package explorer legolaus Eclipse 2 10-07-2009 08:49 AM
How can my view in Eclipse listen to the selection made in the package explorer. poonam12jul Eclipse 0 11-15-2008 02:27 PM
Get the Location of Active View jayjamba Eclipse 0 08-25-2008 03:09 AM
[Eclipse PDE] Accessing Package Explorer mazeli Eclipse 1 08-10-2008 03:21 PM
code to get the location of file in package explorer jayjamba Eclipse 1 03-18-2008 03:04 AM


Copyright 1997-2009, DZone, Inc.
vBulletin Skin developed by: vBStyles.com