Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (780)
Games in Android Showcase (233)
games submitted by our members
Games in WIP (856)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Compiling under Eclipse...  (Read 985 times)
0 Members and 1 Guest are viewing this topic.
Offline WarpZone

Innocent Bystander

« Posted 2007-01-21 05:05:42 »

Edit: I was having some problems getting elcipse to compile, but a friend of mine was able to help me.  Smiley  Here is the complete step-by-step guide he sent me.  I hope this helps you all as much as it did me!  Grin

1 )  New project
2 )  Select Java project and hit next
3 )  Enter a name for the project
4 )  Select "create a new project in workspace"
5 )  Select your compiler compliance level (might as well use 5.0 if you've got it)
6 )  Select "create separate source and output folders" and select the "configure defaults" link next to that
7 )  In your defaults, select "folder" and enter "src" for source and "bin" for output.  (You can use your own names if you want.)  Hit okay.
8 )  Hit finish.  Your project should be created.
9 )  Right-click on the project and do new -> folder.  Call the folder "lib".
10 ) Right-click on "lib" and do "import".
11 ) Select "file system".
12 ) Select the JAR you want to import and import it.  Repeat for each JAR.
13 ) When you're done importing JARs, expand the "lib" folder.  For each JAR, right click on it and select "add to build path".
14 )  Now you can create your packages.  Right click on  src/java and do a "new package".  Call it something like "com.yourdomain.gamename".  If you know  you're going to be developing per a particular architecture, you can create subpackages now, too (e.g., com.yourdomain.gamename.util).
15 )  If you'll have external images, sounds, etc. in your project, right click on "src" (not "src/java", just "src") and make new folders to hold them (so you end up with, for example, "src/java", "src/textures", "src/images", etc.).  You can reference these in the code using relative paths ("src/java/subfolder/filename.ext").
16 )  If you're importing someone else's .jar or .zip for your main app, right-click on src and click "import -> from Archive File".  If you're importing some .src files from a directory, right-click on src and click "import -> from File System."  You'll get your packages built automagically for you.

That's the basic breakdown.  From there, you create your java classes, and you can reference code in the JARs all willy-nilly.  You can also attach source to the JARs (which just tells Eclipse where it can find the source or javadoc) so that you can see the Javadoc comments for the JARs and debug into the JARs, etc.

PS:  When you run your files, you'll have to modify your working directory (in the Arguments tab) to be just "${workspace_loc}", not "${workspace_loc:project_name}".  You'll only have to set this up the first time you run a class - Eclipse will save the run profile for later executions.

Good luck!

Christopher Ellison, E.I.T.

Pages: [1]
  ignore  |  Print  

hadezbladez (730 views)
2018-11-16 13:46:03

hadezbladez (369 views)
2018-11-16 13:41:33

hadezbladez (718 views)
2018-11-16 13:35:35

hadezbladez (184 views)
2018-11-16 13:32:03

EgonOlsen (2379 views)
2018-06-10 19:43:48

EgonOlsen (2533 views)
2018-06-10 19:43:44

EgonOlsen (1470 views)
2018-06-10 19:43:20

DesertCoockie (2135 views)
2018-05-13 18:23:11

nelsongames (1931 views)
2018-04-24 18:15:36

nelsongames (2613 views)
2018-04-24 18:14:32
Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45

Deployment and Packaging
by philfrei
2018-08-20 02:33:38

Deployment and Packaging
by philfrei
2018-08-20 02:29:55

Deployment and Packaging
by philfrei
2018-08-19 23:56:20

Deployment and Packaging
by philfrei
2018-08-19 23:54:46 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!