From: John G. <jge...@ny...> - 2001-11-14 23:52:02
|
> I'm running jEdit on Win32, but I'd like to be able to start it manually > from any arbitrary location using the JRE. Here's the commandline I've > tried: > > %JAVA_HOME%\bin\java.exe -classpath C:/Progra~1/jEdit/jedit.jar > org.gjt.sp.jedit.jEdit C:\AUTOEXEC.BAT > > However, I get a FileNotFoundException when I run this anywhere other > than my jEdit install directory: > > [error] java.io.FileNotFoundException: C:\Program > Files\modes\catalog (The system cannot find the path specified) > [error] at java.io.FileInputStream.open(Native Method) > [error] at > java.io.FileInputStream.<init>(FileInputStream.java:64) > [error] at > org.gjt.sp.jedit.jEdit.loadModeCatalog(jEdit.java:2710) > [error] at > org.gjt.sp.jedit.jEdit.reloadModes(jEdit.java:822) > [error] at org.gjt.sp.jedit.jEdit.main(jEdit.java:307) > Exception in thread "main" [error] > java.lang.NullPointerException: Mode must be non-null > [error] at > org.gjt.sp.jedit.Buffer.setMode(Buffer.java:1372) > [error] at > org.gjt.sp.jedit.Buffer.<init>(Buffer.java:2846) > [error] at > org.gjt.sp.jedit.jEdit.openFile(jEdit.java:1180) > [error] at > org.gjt.sp.jedit.jEdit.openFiles(jEdit.java:1067) > [error] at org.gjt.sp.jedit.jEdit.main(jEdit.java:356) > > What's the secret to get this to work? Why does jEdit have to access > files core to its operation from a relative directory? > > Regards, > Brian. > The startup routine looks for the jEdit installation directory by searching for the 'jedit.jar' entry in the value of the -classpath variable. The next step involves looking for the system-specific value of Path.separator to parse the directory name. Since you use the Unix-style separator instead of the Windows separator, the search fails and the value of the jEdit installation directory defaults to the current working directory. What's the secret to get it to work? Do what jEdit expects you to do and use the operating system's path separator when you specify the classpath. If you don't want to do that, here's another secret: add -Djedit.home=[jedit installation directory] as a parameter to the Java application loader. John |