• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to import game to eclipse or netbeans

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi I have just downloaded a game source file from a website its pretty much a very simple 2d rpg game. how would I go about importing it to eclipse or netbeans so I can play about with it ?
 
Marshal
Posts: 79153
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you create a directory with the game files in? If you have a .jar file to run, then you don't want to run it from Eclipse. You want to run the .jar itself. Look in the Java™ Tutorials.
 
Rancher
Posts: 1093
29
Netbeans IDE Oracle MySQL Database Tomcat Server C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Start a new project, then add the files. If you know what the Class name is that is the entry point, then call the project by that name.
 
mitchell cooper
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I found the main file but still cant get it to run. I got it from a free code website do you think its ok to put it up on here, so you guys can help ?
 
Les Morgan
Rancher
Posts: 1093
29
Netbeans IDE Oracle MySQL Database Tomcat Server C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If the file is of any size, then it is very impractical to post it to a forum.

Look at the "main" file as you call it, what ever the name of that object is, then you are going to have to have the folder and probably the project called the same.

mitchell cooper wrote:I found the main file but still cant get it to run. I got it from a free code website do you think its ok to put it up on here, so you guys can help ?

 
mitchell cooper
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
done that still says editor does not contain main type
 
Sheriff
Posts: 7125
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the exact text of the error? What program is reporting this error? Can you give any other details that will help us?
 
mitchell cooper
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The first two images is the system of files and the third is of main class, there are two folders with main... main and main.class. when I run main I does not do anything but when I start main.class, the game flashes the start sceen the shuts off.
image-1.png
[Thumbnail for image-1.png]
image-2.png
[Thumbnail for image-2.png]
image-3.png
[Thumbnail for image-3.png]
 
Knute Snortum
Sheriff
Posts: 7125
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Those screenshots are hard to read but it looks like main() in Game is what you want to execute (third image). If that's what you're doing and the game screen just flashes, then I'd try executing it from the command line.

  • cd to the directory with Game.class in it
  • type: java Game


  • Edit: there's a package statement that I can't make out, so the above won't work. Copy and paste Game.java here and UseCodeTags (this a link).
     
    Les Morgan
    Rancher
    Posts: 1093
    29
    Netbeans IDE Oracle MySQL Database Tomcat Server C++ Java
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    I've had that happen before using NetBeans, there should be an option to set main, choose the file that has the main method in it for the app.

    mitchell cooper wrote:done that still says editor does not contain main type

     
    With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    reply
      Bookmark Topic Watch Topic
    • New Topic