4

I am trying to build a Java project. This used to be a breeze for me but ever since I changed my workspace to another location to store my new projects, I've been running into trouble. I get these two errors.

Description Resource    Path    Location    Type
The project cannot be built until build path errors are resolved    InterviewPractice       Unknown Java Problem
Unbound classpath container: 'JRE System Library [JavaSE-1.7]' in project 'InterviewPractice'   InterviewPractice       Build path  Build Path Problem

I've looked up fixes online but none of them seem to be working for me.

While building the project, selecting the JRE selection. I'm also not sure what to choose. I think default it was set to OSGi/minimum 1.0 but I'm honestly not sure what that does. I simply want to build simple programs for interview practice. So JavaSE-1.7?

when I click JRE system library a popup that says An error has occurred. See error log for more details. java.lang.NullPointerException

Liondancer
  • 15,721
  • 51
  • 149
  • 255

1 Answers1

5

I think it is about your jre version. Did you try jre6 ?

Package Explorer >> Right Click >> Build Patch >> Configure Build Path >> Libraries >>

Delete Your JRE .

Then Add Library >> JRE System Library >> Environments >> Select JRE6 >> Finish

hurricane
  • 6,521
  • 2
  • 34
  • 44
  • ALl i see under libraries is `default system library (unbound)` – Liondancer Jul 24 '14 at 06:17
  • Also when I click JRE system library a popup that says `An error has occurred. See error log for more details. java.lang.NullPointerException` – Liondancer Jul 24 '14 at 06:18
  • You have to download JRE6 or JRE7 and you have to set home_path ! This link usefull for you : http://docs.oracle.com/javase/7/docs/webnotes/install/mac/mac-install-faq.html – hurricane Jul 24 '14 at 06:24
  • okay im downloading it now ill will update you once its done. Thanks! – Liondancer Jul 24 '14 at 06:26
  • When did you download you have to set home path and make my answer list. Then you have to clean and build your project. – hurricane Jul 24 '14 at 06:29
  • I downloaded JDK because according to this (http://stackoverflow.com/questions/1906445/what-is-the-difference-between-jdk-and-jre) JRE is in JDK and I'll need JDK for other project but I am having the same problems.. no fixes =/ – Liondancer Jul 24 '14 at 06:50
  • This worked for my current workspace. However when I switch workspaces, the second one will have the same errors... – Liondancer Jul 24 '14 at 07:02
  • Build Path issue. When you change your workspace your eclipse conf change also. – hurricane Jul 24 '14 at 07:12
  • I think i seem to be understanding what you mean now. When I change workspaces, the JRE isnt there. – Liondancer Jul 24 '14 at 07:14
  • I went into eclipse >> preferences >> installed JRE and nothing is in there and I see this warning on top `The selected JRE does not support the current compiler compliance level of 1.7` – Liondancer Jul 24 '14 at 07:15
  • I told you first you have to install JRE on your MAC. And set home_path http://docs.oracle.com/javase/7/docs/webnotes/install/mac/mac-install-faq.html – hurricane Jul 24 '14 at 07:23
  • I have this in my `.bash_profile` `export JAVA_HOME=$(/usr/libexec/java_home)` and it still isnt working =/ – Liondancer Jul 25 '14 at 01:35