設為首頁收藏本站

艾歐踢論壇

 找回密碼
 立即註冊

QQ登錄

只需一步,快速開始

搜索
熱搜: 活動 交友 discuz
查看: 903|回復: 0
打印 上一主題 下一主題

How to Build “Thinking in Java” Example Files to Run in Eclipse IDE?

[複製鏈接]
跳轉到指定樓層
樓主
發表於 2016-2-19 04:44:00 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
here's what I did to succesfully import the sources found in the "accesss" folder of you code samples:
  • Download the javassist jar as per Bruce's instructions, from here:
  • You must create an Eclipse project for the sources that are used as dependencies for most of the examples, that's the sources in the "net" folder:
    • in eclipse make new java project.
    • select the "net" directory, copy it, then in eclipse select the "src" entry in the project you just made, right click on it and select paste.
    • after eclipse finishes and auto-builds, it will complain about the missing javaassist jar. Right click on the project ->properties->java build path (on the left)->libraries (on the top)-> add external jars... (on the right), browse and select the javassist jar from where you down load it.
    • now the "net" project should be ok in eclipse
  • Now let's create the project for the sources in the "access" folder:
    • create a new java project in eclipse
    • Now, because Bruce structured his classes like crap, we'll have to make the proper structure in eclipse for them. This means: a.create a new package called "access"
    • go to where your the access folder is on your drive, open it, select ONLY the folders (cookie2, desser, mypackage), copy them, then return to eclipse, right click on the "access" package u just made and click paste
    • now go back to the access dir on your drive, select ONLY the .java files (all of them, not the dirs), copy them, the back to eclipse, click on the src entry in the access project and click paste.
  • The access project in elcipse will still complain about missing classes form the "net" resouce. Right click on the project in eclipse->properties->java build path->projects (on the top)-> add(on the right)-> check the net project you created earlier-> click ok twice.

Now it should be ok
I hope you got the idea on how dependencies work in eclipse with this example.
For the other parts of you code samples, create separate java projects, add the classes to the proper package (create the packages if Bruce forgot to), and if you are missing external jars, go tohttp://search.maven.org search and download the jars.

分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 轉播轉播 分享分享 分享淘帖
回復

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 立即註冊

本版積分規則

小黑屋|Archiver|手機版|艾歐踢創新工坊    

GMT+8, 2024-5-16 18:14 , Processed in 0.264325 second(s), 25 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回復 返回頂部 返回列表