existence error on non-java file [message #523294] |
Thu, 25 March 2010 15:23  |
Eclipse User |
|
|
|
I am trying to run Paul Singleton's JPL, a bidirectional interface between Java and Prolog. http://www.swi-prolog.org/packages/jpl/
I have other, all java, projects working fine in Eclipse.
I can run jpl examples from the command prompt, but not from Eclipse. On Eclipse, in the project I set up, I keep getting existence errors concerning the test.pl prolog file which is in the src directory with the Test.java file, and which gets sent to the bin folder by the compiler. I tried jarring test.pl, tried making it a separate project, tried referring to it on the build path in any way I could think of. Nothing worked.
I have a screen shot: where on the left, the command prompt is in the bin folder of the Eclipse workspace, I call java Test and Paul Singleton's tests all work. On the right is Eclipse being asked to run the same file in the very same folder as a java application where I seem to be told that test.pl does not exist. I suspect things go wrong in Eclipse already during compilation. I used javac in the command prompt to get the working version.
The error is: Exception in thread "main" jpl.PrologException: PrologException: error(existence_error(source_sink, 'test.pl'), _0)
How do I get Eclipse to see that the file is in the src folder with the java file?
Thanks for any help,
Bob Wengert
|
|
|
Re: existence error on non-java file [message #523346 is a reply to message #523294] |
Thu, 25 March 2010 17:14   |
Eclipse User |
|
|
|
Robert Wengert wrote:
> I am trying to run Paul Singleton's JPL, a bidirectional interface
> between Java and Prolog. http://www.swi-prolog.org/packages/jpl/
>
> I have other, all java, projects working fine in Eclipse.
>
> I can run jpl examples from the command prompt, but not from Eclipse. On
> Eclipse, in the project I set up, I keep getting existence errors
> concerning the test.pl prolog file which is in the src directory with
> the Test.java file, and which gets sent to the bin folder by the
> compiler. I tried jarring test.pl, tried making it a separate project,
> tried referring to it on the build path in any way I could think of.
> Nothing worked.
> I have a screen shot: where on the left, the command prompt is in the
> bin folder of the Eclipse workspace, I call java Test and Paul
> Singleton's tests all work. On the right is Eclipse being asked to run
> the same file in the very same folder as a java application where I seem
> to be told that test.pl does not exist. I suspect things go wrong in
> Eclipse already during compilation. I used javac in the command prompt
> to get the working version.
>
> The error is: Exception in thread "main" jpl.PrologException:
> PrologException: error(existence_error(source_sink, 'test.pl'), _0)
>
> How do I get Eclipse to see that the file is in the src folder with the
> java file?
> Thanks for any help,
>
> Bob Wengert
>
>
>
My guess would be that you are having a problem with the working
directory where your launch is being run. Open up the Launch
Configuration you are using to run the examples. On the Arguments tab,
you can set the working directory to run your application. Work with
this to find the correct directory in your project to be able to find
the file.
|
|
|
Re: existence error on non-java file [message #523414 is a reply to message #523346] |
Fri, 26 March 2010 07:27  |
Eclipse User |
|
|
|
Thank you very much.
I changed the Working Directory option from Default: ${workspace_loc: JPLTests} to Other: ...\JPLTests\src and the program ran perfectly.
Clearly I need to learn more about how that workspace_loc variable gets set.
Again, thanks for the on-target advice.
Bob
|
|
|
Powered by
FUDForum. Page generated in 0.07043 seconds