Sandy

From Finninday
Revision as of 21:35, 14 August 2010 by Rday (Talk | contribs)

Jump to: navigation, search
  • fails when run from a jar like this:
2010-08-14 14:16:57.785: problem with dir file:/Users/rday/Desktop/sandy-processes/linearize/   
2010-08-14 14:16:57.786: Are the necessary files present with the correct permissions?

Had to add more diagnostics because when it works in eclipse, no messages are generated.

  • looks like this when it succeeds in eclipse:
2010-08-14 14:30:43.147: Testing dir (string): /Users/rday/Desktop/sandy-processes/linearize/
2010-08-14 14:30:43.149: Testing dir (file): /Users/rday/Desktop/sandy-processes/linearize
2010-08-14 14:30:43.160: Testing file (string): /Users/rday/Desktop/sandy-processes/linearize/run_proc_sandy.pl
2010-08-14 14:30:43.161: Testing file (file): /Users/rday/Desktop/sandy-processes/linearize/run_proc_sandy.pl
2010-08-14 14:30:43.161: Testing file (string): /Users/rday/Desktop/sandy-processes/linearize/linearize_gtsm_new.x
2010-08-14 14:30:43.162: Testing file (file): /Users/rday/Desktop/sandy-processes/linearize/linearize_gtsm_new.x
2010-08-14 14:30:43.163: Running process...Linearize on file /Users/rday/B018_CH0_int
  • looks like this when it fails from the jar
0-08-14 14:25:27.24: Testing resource (string): file:/Users/rday/Desktop/sandy-processes/linearize/
2010-08-14 14:25:27.25: Testing resource (file): file:/Users/rday/Desktop/sandy-processes/linearize
2010-08-14 14:25:27.26: problem with dir file:/Users/rday/Desktop/sandy-processes/linearize/   
2010-08-14 14:25:27.28: Are the necessary files present with the correct permissions?
  • root dir looks like this when run from eclipse
2010-08-14 14:29:49.692: Running withing eclipse, faking jar location.
2010-08-14 14:29:49.694: Location of jar: /Users/rday/Desktop/
  • root dir looks like this when run from a jar
2010-08-14 14:32:07.343: Location of jar: file:/Users/rday/Desktop/

Look at that, the rootPath variable has a "file:" prefix when run from a jar. Why would that be? rootPath is a string and I'm using it like this:

                                rootPath = "" + getClass().getResource("/");
				if (rootPath.contains("rday/Documents/workspace")){
					rootPath = "/Users/rday/Desktop/";
					addToLog("Running withing eclipse, faking jar location.");
				}
				addToLog("Location of jar: "+rootPath);

I suppose I need to strip off the "file:" prefix if it exists.