Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Setting build path has encountered a problem
Setting build path has encountered a problem [message #520316] Thu, 11 March 2010 16:56 Go to next message
Eclipse UserFriend
Project x and project y reside in the same eclipse workspace root directory. I am trying to add a jar file that resides in project x to project y by using Properties->JavaBuildPath->Libraries->Add Jars

After I do so and say ok, a window pops up with the following error message:

"Setting build path has encountered a problem
And Internal error occured during 'Setting build path'"

And the following stacktrace can be found in the log:

java.lang.NullPointerException
	at org.eclipse.core.runtime.Path.<init>(Path.java:183)
	at org.eclipse.core.internal.resources.WorkspaceRoot.getProject(WorkspaceRoot.java:179)
	at org.eclipse.jdt.internal.core.ExternalFoldersManager.isExternalFolderPath(ExternalFoldersManager.java:77)
	at org.eclipse.jdt.internal.core.JavaProject.addToResult(JavaProject.java:2651)
	at org.eclipse.jdt.internal.core.JavaProject.resolveClasspath(JavaProject.java:2628)
	at org.eclipse.jdt.internal.core.JavaProject.resolveClasspath(JavaProject.java:2679)
	at org.eclipse.jdt.internal.core.JavaProject.getResolvedClasspath(JavaProject.java:1866)
	at org.eclipse.jdt.internal.core.ProjectReferenceChange.updateProjectReferencesIfNecessary(ProjectReferenceChange.java:46)
	at org.eclipse.jdt.internal.core.ChangeClasspathOperation.classpathChanged(ChangeClasspathOperation.java:59)
	at org.eclipse.jdt.internal.core.SetClasspathOperation.executeOperation(SetClasspathOperation.java:62)
	at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:728)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1800)
	at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:793)
	at org.eclipse.jdt.internal.core.JavaProject.setRawClasspath(JavaProject.java:2890)
	at org.eclipse.jdt.internal.core.JavaProject.setRawClasspath(JavaProject.java:2906)
	at org.eclipse.jdt.internal.ui.wizards.buildpaths.BuildPathsBlock.flush(BuildPathsBlock.java:911)
	at org.eclipse.jdt.internal.ui.wizards.buildpaths.BuildPathsBlock.configureJavaProject(BuildPathsBlock.java:735)
	at org.eclipse.jdt.internal.ui.wizards.buildpaths.BuildPathsBlock.configureJavaProject(BuildPathsBlock.java:731)
	at org.eclipse.jdt.internal.ui.preferences.BuildPathsPropertyPage$1.run(BuildPathsPropertyPage.java:214)
	at org.eclipse.jdt.internal.core.BatchOperation.executeOperation(BatchOperation.java:39)
	at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:728)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1800)
	at org.eclipse.jdt.core.JavaCore.run(JavaCore.java:4694)
	at org.eclipse.jdt.internal.ui.actions.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:106)
	at org.eclipse.jdt.internal.ui.actions.WorkbenchRunnableAdapter$1.run(WorkbenchRunnableAdapter.java:121)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)


After that, each time I go to Properties->JavaBuildPath->Libraries and click on any library the error window pops up again and another callstack show with a Nullpointer exception in org.eclipse.core.runtime.Path.<init>.



When I now try to close the workspace it says:

'Problems occured while trying to save the state of the workbench

Again a Nullpointer exception from the same location.

This does not happen always and with all jars in this directory. It seems to be rather random. I can't make any sense of it. I tried to delete the .classpath file of project y, even completely recreated project y, but nothing helped. If I have the jar that I want to use in project y's own project folder, I can add it without problems, but due to my build system's logic that is not an option for me.

Is this a known bug and is there a workaround?




[Updated on: Thu, 11 March 2010 17:01] by Moderator

Re: Setting build path has encountered a problem [message #520356 is a reply to message #520316] Fri, 12 March 2010 00:08 Go to previous messageGo to next message
Eclipse UserFriend
Have you tried using:

Java Build Path -> Libraries -> add EXTERNAL jar

I suspect that the null pointer is because with -> Add jar the file must be internal to the list of files/dir of a given project and in your case you want a jar in Project X that is actually in Project Y.

(The above option is in Eclipse Ganymede 3.5.X)

Re: Setting build path has encountered a problem [message #520532 is a reply to message #520316] Fri, 12 March 2010 12:59 Go to previous messageGo to next message
Eclipse UserFriend
Timm wrote:
> [...]Is this a known bug and is there a
> workaround?

The best way to answer that is by searching the bug database,
http://bugs.eclipse.org .
Re: Setting build path has encountered a problem [message #520548 is a reply to message #520356] Fri, 12 March 2010 14:13 Go to previous messageGo to next message
Eclipse UserFriend
pkapur wrote on Fri, 12 March 2010 00:08
Have you tried using:

Java Build Path -> Libraries -> add EXTERNAL jar

I suspect that the null pointer is because with -> Add jar the file must be internal to the list of files/dir of a given project and in your case you want a jar in Project X that is actually in Project Y.

(The above option is in Eclipse Ganymede 3.5.X)




That does not really solve my problem, since it adds an absolute path which I do not want. And adding a jar in another directory should be possible as long as it is also within the workspace directory. I have done this a hundred times before. And it actually works with most of my jars.

It seems to fail however with one particular jar file. If I edit the .classpath file by hand to set relative paths, the project opens without problems. In the referenced library section this jar file appears twice for some reasons with two different icons, but without the error sign.

If I go into the build-path UI in Properties, there is a red error sign however. And I get a null pointer exception again.

I am using Eclipse 3.5.2, JRE build 1.6.0_10-b33

Re: Setting build path has encountered a problem [message #520565 is a reply to message #520548] Fri, 12 March 2010 14:48 Go to previous messageGo to next message
Eclipse UserFriend
"Timm" <kenseyx@yahoo.com> wrote in message
news:hne3oo$kit$1@build.eclipse.org...
> pkapur wrote on Fri, 12 March 2010 00:08
>> Have you tried using:
>>
>> Java Build Path -> Libraries -> add EXTERNAL jar I suspect that the null
>> pointer is because with -> Add jar the file must be internal to the list
>> of files/dir of a given project and in your case you want a jar in
>> Project X that is actually in Project Y.
>>
>> (The above option is in Eclipse Ganymede 3.5.X)
>
>
> That does not really solve my problem, since it adds an absolute path
> which I do not want. And adding a jar in another directory should be
> possible as long as it is also within the workspace directory. I have done
> this a hundred times before. And it actually works with most of my jars.
>
> It seems to fail however with one particular jar file. If I edit the
> .classpath file by hand to set relative paths, the project opens without
> problems. In the referenced library section this jar file appears twice
> for some reasons with two different icons, but without the error sign.
>
> If I go into the build-path UI in Properties, there is a red error sign
> however. And I get a null pointer exception again.
> I am using Eclipse 3.5.2, JRE build 1.6.0_10-b33
>
>

Have you explorered using Project references. This allows you to access the
classes/jars of a different project. In the project containing the jar
files that you want to use, go to the Java Build Path Order and Export tab.
Select the jar files you want to have access to from other projects.
Selecting them "exports" the jar file to referenced projects.

In the other project, go to the Java Build Path Projects tab and add the
project containing the jar file. It is now on the build path of the
project.
Re: Setting build path has encountered a problem [message #527366 is a reply to message #520316] Thu, 15 April 2010 01:02 Go to previous message
Eclipse UserFriend
Same here. When closing Eclipse the following error is return "Problems occurred while trying to save the state of the workbench"

What works for me is I changed the security setting CHMOD on all files and sub-folders in my workspace folder. Especially the .settings folder located under
.../workspace/my-project-name-here/.settings/

IMPORTANT note: Often folders starting with a dot '.' are hidden by your OS. So you must first un-hide them. Then second change their permissions. Otherwise the permissions will be change only on visible folders & files.

[Updated on: Thu, 15 April 2010 01:14] by Moderator

Previous Topic:Eclipse IDE Environment
Next Topic:Startup Problem
Goto Forum:
  


Current Time: Fri Mar 14 02:33:38 EDT 2025

Powered by FUDForum. Page generated in 0.06381 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top