• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java Netbeans(PC) import existing project created with Mac  RSS feed

 
R L Miller
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have been given a .zip file that for a course that I am supposed to modify. The problem is that I cannot even get the import to work. I am not sure whether the problem is because the project was originally created in a Mac environment or that I am just dropping the ball. I have very limited (almost 0) experience working with existing code bases since up to this point we have only been writing our own tiny projects.

I have tried:
1. Using the 'create project with existing sources' which did not work.
2. Using the 'import zip file' again did not work.
3. creating a new project and just dumping all of the files in the source directory. This came the closest to working but I lost the vast majority of the functionality.
4. several haphazard variation of the items above.

I really don't even know enough about Java/Netbeans to even attempt to troubleshoot. At this point, I am just blindly pointing and clicking. I do know that when I import none of the image files or sound files show up in my Netbeans project tree. When I search the results are always "follow these simple 5 steps...." and they never work. Surely, this must be a common process that needs to be followed and yet I have been unable to figure this out. Any help would be appreciated. I the file taxonomy as well as the error message I am receiving.
javaerror.PNG
[Thumbnail for javaerror.PNG]
Compiler error
importtree.PNG
[Thumbnail for importtree.PNG]
Folder taxonomy
 
Knute Snortum
Sheriff
Posts: 4288
127
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post the code for the class FourRowSolitaire, and please UseCodeTags (that's a link).
 
R L Miller
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Norm Radder
Rancher
Posts: 2240
28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a missing/misplaced image file?

Note: Please copy and paste error messages (instead of an image) so text can be copied to include in any responses. 
 
Knute Snortum
Sheriff
Posts: 4288
127
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.  It looks like I need to see SolitaireBoard.java too. 
 
R L Miller
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, There are a ton of image and sound files that don't (appear to)come with the import. I tried to manually paste them all in the source folder with the .java files but that didn't work either. I actually had to change the path to the game board manually and it would load the game board but nothing else. There are enough images that manually changing the path for each image/sound file would be cruel and unusual punishment and therefore cannot be the solution the instructor was looking for. 
 
R L Miller
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Knute Snortum
Sheriff
Posts: 4288
127
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
R L Miller wrote:Yes, There are a ton of image and sound files that don't (appear to)come with the import. I tried to manually paste them all in the source folder with the .java files but that didn't work either.

What happened exactly?  Was there an error message?

I actually had to change the path to the game board manually and it would load the game board but nothing else. There are enough images that manually changing the path for each image/sound file would be cruel and unusual punishment and therefore cannot be the solution the instructor was looking for. 

Are you using a build tool like Maven or Gradle?  How is your classpath being set?
 
Knute Snortum
Sheriff
Posts: 4288
127
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Have you tried putting a "/" in front of "images"?
 
R L Miller
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am just using the standard Netbeans create new project with existing code. I am honestly not even sure what Maven or Gradle are so I don't think i am using either. No it didn't provide any errors when the project was completed but it didn't capture any of the image files in the Netbeans project tree.

@Knute Snortem I could manually change the file path for logo.png and make that work when I pushed all images to the source folder but only the game board showed up, no cards or any other features. This leads me to believe I would need to modify the path for each image before the program would work. I may be incorrect but that was just an assumption on my part.
 
Norm Radder
Rancher
Posts: 2240
28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
pushed all images to the source folder

That's not the solution.  The program is looking for the image to be in the images folder which should be on the classpath when the program executes.
Make sure the images folder in is a folder on the classpath.
 
Knute Snortum
Sheriff
Posts: 4288
127
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

As this code stands, "logo.png" will be expected to be in the FourRowSolitaire/images directory.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!