[MicroEmulator-dev] Mapping source code to eclipse.

18 views
Skip to first unread message

Naveen DS

unread,
Feb 23, 2010, 5:40:52 AM2/23/10
to microemulator-developers
Hi,
Can someone explain how to map the microemulator's source code in
eclipse.

Bartek Teodorczyk

unread,
Feb 26, 2010, 6:56:48 AM2/26/10
to microemulato...@googlegroups.com
Hi,

There is a special maven task create initial .project and .classpath files:

mvn eclipse:clean eclipse:eclipse -DdownloadSources=true

Then use Eclipse "Import..." feature, minimum module set is
microemu-cldc, microemu-midp, microemu-javase, microemu-injected,
microemu-javase-swing.

BR,
Bartek Teodorczyk

> --
> You received this message because you are subscribed to the Google Groups "microemulator-developers" group.
> To post to this group, send email to microemulato...@googlegroups.com.
> To unsubscribe from this group, send email to microemulator-deve...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/microemulator-developers?hl=en.
>
>

Naveen DS

unread,
Mar 26, 2010, 10:43:58 AM3/26/10
to microemulator-developers
I did as above, and mapped to eclipse, now when i select a text(eg. a
class name),right click on it and clicking on "open declaration" , i
get dialog box saying "the resource is not on the build path of the
java project". To understand key parts of the code, If we select and
double click on a method or class will open its declaration. How to
get this ??

Naveen DS

unread,
Mar 27, 2010, 1:58:19 PM3/27/10
to microemulator-developers
Hi,
Where will the .classpath and .project files be created ? I did the
same and used eclipse to import, and I selected the microemulator-
readonly folder into eclipse. But still, cross (x) symbol is coming
in red near the lines of code(Means there is error of dependancy)..
Can you provide me a solution.?
Thanks ..

On Feb 26, 4:56 pm, Bartek Teodorczyk <bar...@gmail.com> wrote:

Bartek Teodorczyk

unread,
Mar 29, 2010, 6:26:10 AM3/29/10
to microemulato...@googlegroups.com
Eclipse files .project and .classpath are created in this Maven task:

mvn eclipse:clean eclipse:eclipse -DdownloadSources=true

BR,
Bartek Teodorczyk

Bartek Teodorczyk

unread,
Mar 29, 2010, 6:27:19 AM3/29/10
to microemulato...@googlegroups.com
What specific class are you trying to open with open declaration?

BR,
Bartek Teodorczyk

naveen

unread,
Mar 29, 2010, 2:17:28 PM3/29/10
to microemulato...@googlegroups.com
Thanks a lot for replying sir, I did the same as you have said above. After that I clicked on "import Project" and in corresponding window , I selected ,"Existing projects into workspace" and selected /microemulator-readonly/microemulator as root of the project. Then Eclipse starts importing, but is reporting many errors saying classes are missing. How to get around this problem.?
        
--
-D.S.Naveen
College of Engineering Guindy,
Anna University

Bartek Teodorczyk

unread,
Apr 6, 2010, 7:06:47 AM4/6/10
to microemulato...@googlegroups.com
Which classes are missing?

BR,
Bartek Teodorczyk

naveen

unread,
Apr 7, 2010, 9:03:41 AM4/7/10
to microemulato...@googlegroups.com
I dont think its the problem of missing classes(classes were missing from build path actually), so I used another way of importing the project. What I did was .. 
  1. Created a new Java Project.
  2. Then did this, File->Import, and in the next dialog under , General , selected File System. 
  3. In the next window, I selected the root folder ie.. "microemu-read-only".
 Then all the files were imported into the workspace(with no errors).

Now the problem is,  I was reading the file MIDletAccess.java inside microemu-midp, and when I right clicked on DisplayAccess on the line 35 and selecting "open declaration" gives a dialog box saying "The resource is not on the build path of the project". When I checked with other files also , I am getting the same problem.. See the screenshot provided here .. What needs to be donce to get around this problem and how to compile and run the project .. ?? 
Thanks ..
Screenshot.png
Screenshot.png

Bartek Teodorczyk

unread,
Apr 7, 2010, 9:13:25 AM4/7/10
to microemulato...@googlegroups.com
MIDletAceess.java has to be in a build path. To do that in Eclipse, right click on "java" label:

"java"
-> javax
-> org
   -> microemu
      -> (...)

and select "Build Path" and "Use as Source Folder"

BR,
Bartek Teodorczyk
Screenshot.png

naveen

unread,
Apr 7, 2010, 9:24:16 AM4/7/10
to microemulato...@googlegroups.com
You mean the "Java" Label in the Package Explorer ?? Or where is the Label..
Screenshot.png

Bartek Teodorczyk

unread,
Apr 7, 2010, 9:26:19 AM4/7/10
to microemulato...@googlegroups.com
Exactly, the "Java" Label in the Package Explorer.

BR,
Bartek Teodorczyk
Screenshot.png

naveen

unread,
Apr 7, 2010, 9:35:50 AM4/7/10
to microemulato...@googlegroups.com
I did as the same and should i do for all files ?? I am getting the same error in all files .. And one more thing sir, after I did as u said as above, the MIDletAccess.java moved to the top (in package explorer) under referenced libraries, and if i try to open that , this is the error I am getting ..
Screenshot-1.png
Screenshot.png
Screenshot-1.png

Bartek Teodorczyk

unread,
Apr 8, 2010, 6:34:29 AM4/8/10
to microemulato...@googlegroups.com
I really dont know, why you got MIDletAccess.java in the Referenced Libraries tree, that one should be removed.

Did you really added "java" label from Package Explorer to the build path?

"java"
-> javax
-> org
   -> microemu
      -> (...)

BR,
Bartek Teodorczyk
Screenshot-1.png
Screenshot.png

naveen

unread,
Apr 8, 2010, 7:06:09 AM4/8/10
to microemulato...@googlegroups.com
I have removed that one from referenced libraries tree.

I also have added Java(the one inside microemu-midp) into the build path.. after doing this , the contents inside java folder has been removed and is moved to the top. Stil I get lot of cross (red colored) besides every source file. See the screenshot, what is the problem now .. ?
Screenshot-Java - emulate-microemulator-microemu-midp-src-main-java-org-microemu-MicroEmulator.java - Eclipse Platform .png
Screenshot-Java - emulate-microemulator-microemu-midp-src-main-java-org-microemu-MicroEmulator.java - Eclipse Platform .png
Screenshot-1.png
Screenshot.png

Bartek Teodorczyk

unread,
Apr 8, 2010, 7:12:27 AM4/8/10
to microemulato...@googlegroups.com
Now, it is looking much better :) You are still missing some of the modules in your build path. Now it is time for microemu-cldc/main/java

BR,
Bartek Teodorczyk
Screenshot-Java - emulate-microemulator-microemu-midp-src-main-java-org-microemu-MicroEmulator.java - Eclipse Platform .png
Screenshot-1.png
Screenshot.png

naveen

unread,
Apr 8, 2010, 7:16:04 AM4/8/10
to microemulato...@googlegroups.com
Gr8 :) , thanks, I have also added cldc/main/java now and see some yellow color warning(with exclamatory sign). Do  I need add more modules into build path ?
Screenshot-1.png
Screenshot-Java - emulate-microemulator-microemu-midp-src-main-java-org-microemu-MicroEmulator.java - Eclipse Platform .png
Screenshot.png

Bartek Teodorczyk

unread,
Apr 8, 2010, 7:22:54 AM4/8/10
to microemulato...@googlegroups.com
Yellow is fine :) You'll need also for sure: microemu-injected, microemu-javase and microemu-javase-swing at least.

BR,
Bartek Teodorczyk
Screenshot.png
Screenshot-Java - emulate-microemulator-microemu-midp-src-main-java-org-microemu-MicroEmulator.java - Eclipse Platform .png
Screenshot-1.png

naveen

unread,
Apr 8, 2010, 7:30:44 AM4/8/10
to microemulato...@googlegroups.com
I included injected without any problem , but when i included microemu-javase I get error in Injected.java saying "the type injected is already defined", now with many such errors(red colored cross). See this Screenshot-Java - emulate-microemulator-microemu-javase-src-main-java-org-microemu-Injected.java - Eclipse Platform .png
Screenshot-Java - emulate-microemulator-microemu-midp-src-main-java-org-microemu-MicroEmulator.java - Eclipse Platform .png
Screenshot-1.png
Screenshot.png
Screenshot-Java - emulate-microemulator-microemu-javase-src-main-java-org-microemu-Injected.java - Eclipse Platform .png

Bartek Teodorczyk

unread,
Apr 8, 2010, 7:33:43 AM4/8/10
to microemulato...@googlegroups.com
Remove microemu-injected module, it seems that is no required.

BR,
Bartek Teodorczyk
Screenshot-Java - emulate-microemulator-microemu-midp-src-main-java-org-microemu-MicroEmulator.java - Eclipse Platform .png
Screenshot-1.png
Screenshot-Java - emulate-microemulator-microemu-javase-src-main-java-org-microemu-Injected.java - Eclipse Platform .png
Screenshot.png

naveen

unread,
Apr 8, 2010, 7:47:52 AM4/8/10
to microemulato...@googlegroups.com
Did that and new error came :( ,
"The import org.objectweb cannot be 
resolved" in the file "changeCallsClassVisitor.java, changeCallsMethodVisitor.java ,classPreprocessor.java"   under microemu-javase


and "The import netscape cannot be resolved" in the file "CookieRecordStoreManager.java" under microemu-javase-swing
Screenshot.png
Screenshot-Java - emulate-microemulator-microemu-midp-src-main-java-org-microemu-MicroEmulator.java - Eclipse Platform .png
Screenshot-1.png
Screenshot-Java - emulate-microemulator-microemu-javase-src-main-java-org-microemu-Injected.java - Eclipse Platform .png

Bartek Teodorczyk

unread,
Apr 8, 2010, 7:51:14 AM4/8/10
to microemulato...@googlegroups.com
On Thu, Apr 8, 2010 at 1:47 PM, naveen <naveen....@gmail.com> wrote:
Did that and new error came :( ,
"The import org.objectweb cannot be 
resolved" in the file "changeCallsClassVisitor.java, changeCallsMethodVisitor.java ,classPreprocessor.java"   under microemu-javase


Download asm.jar from http://asm.ow2.org/


and "The import netscape cannot be resolved" in the file "CookieRecordStoreManager.java" under microemu-javase-swing


You can just remove that class.

BR,
Bartek Teodorczyk
 
Screenshot-Java - emulate-microemulator-microemu-midp-src-main-java-org-microemu-MicroEmulator.java - Eclipse Platform .png
Screenshot-1.png
Screenshot.png
Screenshot-Java - emulate-microemulator-microemu-javase-src-main-java-org-microemu-Injected.java - Eclipse Platform .png

naveen

unread,
Apr 8, 2010, 7:58:18 AM4/8/10
to microemulato...@googlegroups.com
I already have that . Included asm in build path now.. No errors now .. :) Thanks a lot :)
Screenshot-1.png
Screenshot.png
Screenshot-Java - emulate-microemulator-microemu-midp-src-main-java-org-microemu-MicroEmulator.java - Eclipse Platform .png
Screenshot-Java - emulate-microemulator-microemu-javase-src-main-java-org-microemu-Injected.java - Eclipse Platform .png
Reply all
Reply to author
Forward
0 new messages