Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (577)
games submitted by our members
Games in WIP (498)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Game Development / Newbie & Debugging Questions / Compiling under Eclipse... on: 2007-01-21 06: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

Quote
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]
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (23 views)
2014-04-15 18:08:23

BurntPizza (18 views)
2014-04-15 03:46:01

UprightPath (32 views)
2014-04-14 17:39:50

UprightPath (16 views)
2014-04-14 17:35:47

Porlus (32 views)
2014-04-14 15:48:38

tom_mai78101 (58 views)
2014-04-10 04:04:31

BurntPizza (116 views)
2014-04-08 23:06:04

tom_mai78101 (216 views)
2014-04-05 13:34:39

trollwarrior1 (183 views)
2014-04-04 12:06:45

CJLetsGame (190 views)
2014-04-01 02:16:10
List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:05:20
java-gaming.org 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‑gaming.org
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!