-
AuthorPosts
-
it was built for windows, but I thought I had taken care of all those “” by using file.separator instead. where are you getting your error?
I couldn’t see the question to you about the compile problem, but I’m getting the same problem.
When I compile the processing script, I get a null pointer exception in call to ReadProfiles().
I believe this is because the call in osPID_FrontEnd
ReadProfiles(curDir+ File.separator + “profiles”);
contains a null string – String curDir = System.getProperty(“user.dir”);If I place a copy of the profiles directory at c: and change the offending line to
String curDir = “c:”;it compiles and runs correctly.
I have experimented with System.getProperty(“user.dir”) in other programs and it works fine. I have installed the code in several different directories with same result.
Thx,
MikeI’m experiencing the same problem. ragaRew’s solution works, but maybe this shed’s some light on the source of the problem.
in osPID_FrontEnd.pde (in a folder D:osPID_FrontEnd)
I insertedSystem.out.println(System.getProperty("user.dir"));
just before:
String curDir = System.getProperty("user.dir");
Then, (click run and) in the processing IDE console window, just before the null pointer debug message(s) it prints your ‘user directory’:
- D:Processingprocessing-1.5.1 – i.e. the location of processing.exe
So it seems that the “user.dir” is the directory of processing.exe, not the sketch (osPID_FrontEnd.pde) folder.
Perhaps the getProperty(“user.dir”) needs to be replaced with either getMainFilePath() or getFolder() method?
as detailed here:
http://processing.googlecode.com/svn/trunk/processing/build/javadoc/everything/processing/app/Sketch.html#getPrimaryFile%28%29
But using Processing v1.5.1 those methods are not recognised – and Processing is completely new to me.I’ll try and find a solution, but Brett will be way more up to speed on this stuff than me.
BTW, thanks Brett/Lim – I’m really enjoying playing with osPID for controlling my Rancilio Silvia coffee machine. Will post some pics of that real soon.
I just discovered Brett already posted the solution to this problem in the following thread:
viewtopic.php?f=4&t=266&p=407#p407 (The one dated Mon Apr 30, 2012 5:19 pm)
In it, he says, ‘…you’ll need to copy the “profiles” folder to the folder containing your processing.exe’After some searching, I still don’t understand why the methods getMainFilePath() or getFolder(), which appear in the code linked to in my previous post, are not available in processing version 2.0b3 (Java). Any ideas?
– Hamish
-
AuthorPosts
- You must be logged in to reply to this topic.