Welcome to the CSC Q&A, where you can get help (and share your knowledge) about computer science!

Lab 1 Part 3- Forking problems?

+11 votes
I was able to get through Part 3 Step 1 and "downloaded" Stupid Text Games. When I opened it up in Eclipse almost every line had a little red x. Has anyone else had problems or know the answer to my problem?
asked Aug 30, 2015 in Fall 15-16 by Kelsey Self (100 points)

2 Answers

+6 votes
Best answer
I recently ran into that problem as well. I did the lab from the Olin lab computers and you're getting the red X's because the library for the Forked project is currently set on 1.8. My laptop is still on 1.7 and the lab computers seem to see the 1.8 library listed as "(unbound)". Because of this, you'll notice that in your project folder for "Stupid Text Games" doesn't even have a JRE System Library.

The work around I tried was editing the 1.8 unbound library and changing the version of it to 1.7. After doing so, a JRE System Library should pop up and the red X's should be removed, at least it did for me.

To do so: right click your project folder > properties > Java Build Path > Select JRE System Library[JavaSE-1.8] (unbound) and edit > execution environment > JavaSE1.7 (jre7) and finish > ok


edit: instructions
answered Aug 30, 2015 by Alerik Vi (100 points)
selected Sep 17, 2015 by Kelsey Self
Thank you so much that helps!!
Ah, thanks for the good information.

That said, I think the *better* solution in this case would be to install Java 8.  If you work in a team where some people are using Java 8 and some are using Java 7, things could get messy.  (There will probably be an annoying commit war where people keeps changing the Java version back and forth between 7 and 8, which keeps breaking the project for other people.)
I did install 8, is it possible that the files that were onto github were from version 7?
I also ended up installing 8 and it didn't help. I made sure I downloaded the development kit as well as the runtime environment and set it to default, but no luck. I also can't seem to follow Alerik's instructions successfully...
I was able to do it by doing this "right click your project folder > properties > Java Build Path" The last parst of his instructions have to be done in the "libraries" tab of the build path option. The default is "order and export." I hope this helps. Good luck!
+3 votes

I know that Evan ran into a similar problem, to which I responded:

I'm not sure what's up with that.  It might be a problem with not finding your Java virtual machine.  You might mess around in Eclipse to see if anything jumps out.

Specifically, right click on the project and choose "properties", then choose "Java Build Path", and check the "Libraries" tab to see if "JRE System Library" is listed there.

Sometimes problems like these can also happen if you had the wrong folder for the project. 

You might try:

a) Posting to the Q&A to see if anyone else has gotten this problem.
b) Restarting Part 3 of the lab, and trying the steps carefully again, to see if it happens again.
c) Sending me screenshots of your problem.
d) Googling for "Eclipse" + the error messages you're seeing.

Or, I can take a look in person on Monday morning.

However,  I don't know whether any of this helped resolved that issue or not.  I will email Evan to about this question on the Q&A.

answered Aug 30, 2015 by Forrest Stonedahl (100 points)