넥슨별의 여행자.....
'사이버탐험기' 카테고리의 다른 글
넥슨별! 이제 슬슬..... (0) | 2010.02.07 |
---|---|
WOW 막막한 퀘스트...... (0) | 2010.02.06 |
에버플레닛... 준비운동.. (0) | 2010.01.30 |
넥슨별 여행..... (0) | 2010.01.30 |
저랩의 와우(The World of warcraft) 방황기 (0) | 2010.01.30 |
넥슨별의 여행자.....
넥슨별! 이제 슬슬..... (0) | 2010.02.07 |
---|---|
WOW 막막한 퀘스트...... (0) | 2010.02.06 |
에버플레닛... 준비운동.. (0) | 2010.01.30 |
넥슨별 여행..... (0) | 2010.01.30 |
저랩의 와우(The World of warcraft) 방황기 (0) | 2010.01.30 |
Version 1.6
Copyright © 2007 - 2009 Lars Vogel
30.12.2009
Revision History | ||
---|---|---|
Revision 0.1 | 18.07.2007 | Lars Vogel |
Created. | ||
Revision 0.2 - 0.7 | 18.05.2008 | Lars Vogel |
Several reworks. | ||
Revision 0.7.1 | 13.04.2009 | Lars Vogel |
Added Shortcut | ||
Revision 0.8 | 25.05.2009 | Lars Vogel |
Update to Eclipse 3.5 (Galileo) | ||
Revision 0.9 | 21.06.2009 | Lars Vogel |
Moved Shortcuts to own article under http://www.vogella.de/articles/EclipseShortcuts/article.html | ||
Revision 1.0 | 22.06.2009 | Lars Vogel |
Moved Debugging to own article under http://www.vogella.de/articles/EclipseDebugging/article.html | ||
Revision 1.1 | 28.06.2009 | Lars Vogel |
Re-org article, own chapter for update manager, simplified views / editor description | ||
Revision 1.2 | 12.07.2009 | Lars Vogel |
Screenshot for link with editor | ||
Revision 1.3 | 18.07.2009 | Lars Vogel |
Added link to example with jars, changed from XML templates to Java template | ||
Revision 1.4 | 02.08.2009 | Lars Vogel |
more details on first Java program | ||
Revision 1.5 | 01.11.2009 | Lars Vogel |
Renamed first project, added details for jar handling | ||
Revision 1.6 | 30.12.2009 | Lars Vogel |
fixed package name in Java program outside Eclipse |
Eclipse Java IDE
This article describes the usage of Eclipse as a Java IDE. It describes the installation of Eclipse, the creation of Java programs, the usage of external jars, quick fix and content assist and the usage of the Eclipse update manager.
This article is based on Eclipse 3.5 (Eclipse Galileo).
Table of Contents
Eclipse an open source community whose projects building tools and frameworks for creating general purpose application.
The most popular usage of Eclipse is as a Java development environment which will be described in this article.
Download "Eclipse IDE for Java Developers" from the website Eclipse Downloads and unpack it to a directory. This is sufficient for Eclipse to be used; no additional installation procedure is required.
To start Eclipse double-click on the file eclipse.exe in your installation directory.
The system will prompt you for a workspace. The workspace is the place there you store your Java projects (more on workspaces later). Select a suitable (empty) directory and press Ok.
Eclipse will start and show the Welcome page.
Close the welcome page by press in little x besides the Welcome.
Eclipse provides perspectives, views and editors. Views and editors are grouped into perspectives. All projects are located in a workspace.
The workspace is the physical location (file path) you are working in. You can choose the workspace during startup of eclipse or via the menu (File-> Switch Workspace-> Others).
All your projects, sources files, images and other artifacts will be stored and saved in your workspace.
A perspective is a visual container for a set of views and editors.
You can change the layout within a perspective (close / open views, editors, change the size, change the position, etc.)
Eclipse allow you to switch to another perspective via the menu Window->Open Perspective -> Other.
For Java development you usually use the "Java Perspective".
A view is typically used to navigate a hierarchy of information or to open an editor. Changes in a view are directly applied.
Editors are used to modify elements. Editors can have code completion, undo / redo, etc. To apply the changes in an editor to the underlying resources, e.g. Java source file, you usually have to save.
The following will describe how to create a minimal Java program using Eclipse. It will be the classical "Hello World" program. Our program will write "Hello Eclipse!" to the console.
Select from the menu File -> New-> Java project. Maintain "de.vogella.eclipse.ide.first" as the project name. Select "Create separate source and output folders".
Press finish to create the project. A new project is created and displayed as a folder. Open the folder "de.vogella.eclipse.ide.first"
Create now a package. A good convention is to use the same name for the top package as the project. Create therefore the package "de.vogella.eclipse.ide.first".
Select the folder src, right mouse click on it and select New -> Package.
Right click on your package and select New -> Class
Create MyFirstClass, select the flag "public static void main (String[] args)"
Maintain the following code.
package de.vogella.eclipse.ide.first;public class MyFirstClass { public static void main(String[] args) { System.out.println("Hello Eclipse!"); }}
Now run your code. Right click on your Java class and select Run-as-> Java application
Finished! You should see the output in the console.
To run your Java program outside of Eclipse you need to export it as a jar file. Select your project, right click on it and select "Export".
Select JAR file, select next. Select your project and maintain the export destination and a name for the jar file. I named it "myprogram.jar".
Press finish. This will create a jar file in your select output directory.
Open a command shell, e.g. under Microsoft Windows select Start -> Run and type in cmd. This should open a consle.
Switch to your output directory, e.g. by typing cd path, e.g. if you jar is located in "c:\temp" type "cd c:\temp".
To run this program you need to include the jar file into your classpath. See Classpath and Java JAR Files for details.
java -classpath myprogram.jar de.vogella.eclipse.ide.first.MyFirstClass
Congratulations! You created your first Java project, a package a tiny Java program and you ran this program inside Eclipse and outside
The content assistant allows you to get input help in an editor. It can be invoked by CTRL + Space.
For example type syso and then press [Ctrl + Space] and it will be replaced by System.out.println(""). Or if you have an object, e.g. Person P and need to see the methods of this object you can type p. (or press CTRL + Space) which activates also the content assist.
Whenever there is a problem Eclipse will underline the problematic place in the coding. Select this and press (Ctrl+1)
For example type "myBoolean = true;" If myBoolean is not yet defined, Eclipse will highlight it as an error. Select the variable and press "Ctrn+1", then Eclipse will suggest to create a field or local variable.
Quick Fix is extremely powerful, it allows you to create new local / field variables, new methods, classes, put try and catch around your exceptions, assign a statement to a variable etc.
The following describes how to add external jars to your project.
The following assumes you have a jar available.
Create a new Java project "de.vogella.eclipse.ide.jars". Create a new folder called "lib" (or use your existing folder) by right click on your project and selecting New -> Folder
From the menu select File -> Import -> File system. Select your jar and select the folder lib as target.
Select your project, right mouse click and select properties. Under libraries select "Add JARs".
The following example shows how the result would look like if junit-4.4.jar would be added to a project.
To browse the source of a type contained in library you can attach a source archive or source folder to this library. The editor will then show the source instead of a the decompiled code. Setting the source attachment also allows source level stepping with the debugger.
The Source Attachment dialog can be reached via:
Open the Java Build Path page of a project (Projects > Properties > Java Build Path). On the Libraries page expand the library's node and select the Source attachment attribute and press Edit
Maintain the location to the source attachement.
In the Location path field, enter the path of an archive or a folder containing the source.
Download the javadoc of the jar and put it somewhere in your filesystem.
Open the Java Build Path page of a project (Projects > Properties > Java Build Path). On the Libraries page expand the library's node and select the Javadoc location attribute and press Edit
Maintain the location to the api.
Eclipse provides functionality via so-called features (which contain plugins). Eclipse 3.5 contains a Software Update Manager which allows you to update existing plugins and to install new plugins.
To update your existing installation select the menu Help -> Check for Updates. The system will verify if for the installed plugins updates are available or not.
To install new functionality, select Help-> Install New Software.
Select from the list a update site from which you would like to install new software. For example if you want to install new plugins from Galileo select the Galileo Update Site.
To add a new update site select, press the button "Add" and input the URL. This will then make this update site available and will allow you to install software from this site.
If you’re using Plugins where no Software Site is available, then you can use the Dropins folder in your Eclipse installation directory.
To do this put the plugin into Eclipse "dropins" folder and restart Eclipse. Eclipse should detect the new plugin and install it for you.
The problems view displays problems in your projects. You can open it via Windows -> Show View -> Problems
You can configure the problems view, e.g. if you only want to display the problems from the current selected project, select "Configure Contents".
Eclipse allows to set semicolons (and other elements) automatically.
Eclipse allows to format the source code and to organize the imports at save.
If you use // TODO in the coding this indicates a task for eclipse and you find it in the task view of Eclipse.
For more advanced tasks you can use Eclipse Mylyn Tutorial .
A common problem in Eclipse is that your data in your workspace grows and therefore your workspace is not well structured anymore. You can use working sets to organize your displayed projects / data. To setup your working set select in the Package Explorer -> Show -> Working Sets.
Press new on the following dialog to create a working set.
On the following dialog select java, select the source folder you would like to see and give it a name. You can now easily display only the files you want to see.
The package explorer allows to display the associated file from the current selected editor. Example: if you working on foo.java and you change in the editor to bar.java then the display in the package explorer will change.
To activate this press "Link with Editor".
If you have to type frequently the same code / part of the d0cument you can maintain templates which can be activate via autocomplete (Ctrl + Space).
For example lets assume you are frequently creating "public void name(){}" methods. You could define a template which creates the method body for you.
To create a template for this select the menu Window->Preferences and Open Java -> Editor -> Templates
Press New. Create the following template. ${cursor} indicates that the cursor should be placed at this position after applying the template.
This this example the name "npm" is your keyword.
Now every time you type the keyword in the Java editor and press Ctrl+Space the system will replace your text with your template.
To learn how to debug Eclipse Java programs you can use Eclipse Debugging
To learn Java Web development you can use with Servlet and JSP development with Eclipse Web Tool Platform (WTP) - Tutorial . If you want to develop rich stand-alone Java clients you can use Eclipse RCP - Tutorial
. Check out Eclipse Plugin Development - Tutorial to learn how to develop your own plugins.Good luck in your journey of learning Java!
Thank you for practicing with this tutorial.
Please note that I maintain this website in my private time. If you like the information I'm providing please help me by donating.For questions and discussion around this article please use the www.vogella.de Google Group. Also if you note an error in this article please post the error and if possible the correction to the Group.
I believe the following is a very good guideline for asking questions in general and also for the Google group How To Ask Questions The Smart Way.
http://www.vogella.de/code/codeeclipse.html Source Code of Examples
베스트 20 윈도우 모바일 어플 (0) | 2010.02.15 |
---|---|
Android Development with Eclipse - Tutorial (0) | 2010.02.06 |
Developing open source Java applications with java.net and Eclipse (0) | 2010.01.30 |
게임 서버의 구조 (1) | 2010.01.23 |
스마트그리드 개념 : form 스마트그리드협회 (0) | 2010.01.23 |
에버플레닛... 준비운동..
WOW 막막한 퀘스트...... (0) | 2010.02.06 |
---|---|
넥슨별의 여행자..... (0) | 2010.02.06 |
넥슨별 여행..... (0) | 2010.01.30 |
저랩의 와우(The World of warcraft) 방황기 (0) | 2010.01.30 |
SL 탐험기 2010.01.24 세컨드라이프라니... (1) | 2010.01.24 |
넥슨별 여행.....
넥슨별의 여행자..... (0) | 2010.02.06 |
---|---|
에버플레닛... 준비운동.. (0) | 2010.01.30 |
저랩의 와우(The World of warcraft) 방황기 (0) | 2010.01.30 |
SL 탐험기 2010.01.24 세컨드라이프라니... (1) | 2010.01.24 |
저랩의 와우이야기1 (0) | 2010.01.23 |
저랩의 와우(The World of warcraft) 방황기
그냥 돌아댕기기...
에버플레닛... 준비운동.. (0) | 2010.01.30 |
---|---|
넥슨별 여행..... (0) | 2010.01.30 |
SL 탐험기 2010.01.24 세컨드라이프라니... (1) | 2010.01.24 |
저랩의 와우이야기1 (0) | 2010.01.23 |
넥슨의 별나라 이야기!!!!! (0) | 2010.01.23 |
The instructions in this tutorial are based on Eclipse 3.0. Later versions of Eclipse 3.x may vary slightly. |
If you have problems downloading or starting Eclipse, see the Eclipse FAQ. |
PerspectivesThe "Java" perspective (which we're currently in) provides editors, views, and menu items which are useful for developing Java applications. The "Resource" perspective (which we started off from) provides a more basic set of tools, for example a Windows Explorer style file navigator. You can quickly switch between perspectives using the buttons to the top right of the Eclipse window: |
Output folder When you use custom source folders, the compiler stores the generated class files in a separate folder called the "output folder". As you can see from the dialog above, the output folder is set to a "bin" subdirectory under the project. Leave this setting alone unless you have a good reason. Note that you won't see the bin subdirectory or class files in the Package Navigator by default. Switch to the Resource perspective to see an unfiltered view of all project files and directories. |
If you don't have any existing source code to import into Eclipse, skip to the next section. |
Although reversing the domain name is common practise for package names, please DON'T use net.java as a project prefix. See this wiki entry for an explanation.. |
Views and editors Eclipse makes a distinction between views and editors. An editor is a window which directly displays editable content, such as the Java editor above. When you make a change in an editor, the change doesn't take effect until you save the editor. You can tile and layer editors in various ways by dragging their title bars. To see a list of all open editors, press Ctrl-E. A view is a window which displays a more abstract representation of content, for example the Package Explorer, Problems, and Outline views above. Changes made in a view take effect immediately. You can dock, layer, and tile views is various positions by dragging their title bars. To open a new view, select Window->Show View->Other... To toggle maximisation of the current view or editor, double-click its title bar or press Ctrl-M. |
Use a single project for java.net applications If you're creating an application which you're going to host at java.net, use a single project. This will make it easier to work with CVS. If you want to keep different parts of your application code separate, use source folders. If want to use a third party Eclipse project ( for example another Eclipse-based project hosted on java.net), use a JAR file containing the project's classes rather than a project dependency. |
Android Development with Eclipse - Tutorial (0) | 2010.02.06 |
---|---|
Eclipse Java IDE - Tutorial (1) | 2010.01.30 |
게임 서버의 구조 (1) | 2010.01.23 |
스마트그리드 개념 : form 스마트그리드협회 (0) | 2010.01.23 |
스마트그리드 ( Smart Grid) 요약보고서 (0) | 2010.01.23 |
SL 탐험기 2010.01.24 세컨드라이프라니...
넥슨별 여행..... (0) | 2010.01.30 |
---|---|
저랩의 와우(The World of warcraft) 방황기 (0) | 2010.01.30 |
저랩의 와우이야기1 (0) | 2010.01.23 |
넥슨의 별나라 이야기!!!!! (0) | 2010.01.23 |
넥슨별 레벨업!!!! (0) | 2010.01.17 |
NPC란? Non-Player Characters 의 약자이다. 게임에서 유저 캐릭터가 아닌 서버에 의해조종되는 캐릭터를 총칭하는 말이다. 온라인 게임에서는 보통 상점주인, 경비병, 몬스터등이 이에 속한다.
참고> 서버 기능 분리시 주의사항서버를 분리하는데에는 많은 사항을 고려해야 한다. 서버의 기능을 나누어 부하를 분산시키는것은 좋지만 서버를 나누어서 새롭게 생겨날 수 있는 취약점이나 또 다른 부하를 고려해야 하기때문이다. 예를 들어 NPC 서버가 분리된다면 게임 서버와 NPC 서버간의 동기화, NPC 서버와게임 서버간의 통신으로 인한 네트워크 오버헤드를 고려해야 한다.동기화 서버가 분리되면 역시 동기화 서버와 게임 서버간의 통신으로 인한 네트워크 오버헤드와게임서버와 동기화 서버의 권한을 명확히 해야 한다. 채팅 서버가 분리 된다면 채팅 서버와 게임서버간의 동기화 문제를 고려해야 한다.
replication란? 데이터베이스의 복제 기능이다. 똑같은 정보를 가지고 있는데이터베이스들끼리 연결되어 한쪽 데이터베이스에 정보가 입력된다면 입력된 데이터를다른 데이터베이스에도 똑같이 입력되게 하는 데이터베이스 기능이다.
클래스 | IP 대역 | 네트워크당 수용 호스트 수 |
A Class | 10.0.0.0 ~ 10.255.255.255 | 16777214 개 |
B Class | 172.16.0.0 ~ 172.31.255.255 | 65534 개 |
C Class | 192.168.0.0 ~ 192.168.255.255 | 254 개 |
공인 IP | 사설 IP | |
차이점 | 클라이언트와의 통신 | 서버간의 통신 |
서버간의 통신 사용불가 | 클라이언트간 통신 사용불가 | |
공통점 | 서버간의 통신에서 네트워크 대역폭 확보 및 물리적인 보안 |
TCPWRAPPER란? Wietse Vanema 에 의해 제작된 TCPwapper 는 호스트 레벨에서 특정프로토콜과 포트, 네트워크 IP 에 따른 접속허가를 내줄 것인지 거부할 것인지 결정하는packet dropper 이라고 볼 수 있다.
Eclipse Java IDE - Tutorial (1) | 2010.01.30 |
---|---|
Developing open source Java applications with java.net and Eclipse (0) | 2010.01.30 |
스마트그리드 개념 : form 스마트그리드협회 (0) | 2010.01.23 |
스마트그리드 ( Smart Grid) 요약보고서 (0) | 2010.01.23 |
Apple 타블렛은 “촉각 피드백 기능”이 추가? (1) | 2010.01.18 |
Developing open source Java applications with java.net and Eclipse (0) | 2010.01.30 |
---|---|
게임 서버의 구조 (1) | 2010.01.23 |
스마트그리드 ( Smart Grid) 요약보고서 (0) | 2010.01.23 |
Apple 타블렛은 “촉각 피드백 기능”이 추가? (1) | 2010.01.18 |
Introducing Calculon – a Java DSL for Android Activity testing (0) | 2010.01.17 |
전력시스템과 IT 기술의 융합,
스마트 그리드 요약보고서....
전력시스템을 익히자!!!!!!
1264251649_스마트 그리드 - 요약보고서.pdf
게임 서버의 구조 (1) | 2010.01.23 |
---|---|
스마트그리드 개념 : form 스마트그리드협회 (0) | 2010.01.23 |
Apple 타블렛은 “촉각 피드백 기능”이 추가? (1) | 2010.01.18 |
Introducing Calculon – a Java DSL for Android Activity testing (0) | 2010.01.17 |
Beginner iPhone SDK Hello World Tutorial [Example & Code] (0) | 2010.01.17 |
저랩의 우울함.....
저랩의 와우(The World of warcraft) 방황기 (0) | 2010.01.30 |
---|---|
SL 탐험기 2010.01.24 세컨드라이프라니... (1) | 2010.01.24 |
넥슨의 별나라 이야기!!!!! (0) | 2010.01.23 |
넥슨별 레벨업!!!! (0) | 2010.01.17 |
넥슨별 생활이란.... (0) | 2010.01.10 |
넥슨별에 별스타 방문.....
별심부름이네요....
SL 탐험기 2010.01.24 세컨드라이프라니... (1) | 2010.01.24 |
---|---|
저랩의 와우이야기1 (0) | 2010.01.23 |
넥슨별 레벨업!!!! (0) | 2010.01.17 |
넥슨별 생활이란.... (0) | 2010.01.10 |
꿈의 별! 넥슨별! (0) | 2010.01.03 |