Fix for MSWindows batch scripts (and paths w/spaces)

This is where you talk about the NXJ software itself, installation issues, and programming talk.

Moderators: imaqine, 99jonathan, roger

New User
Posts: 17
Joined: Tue Aug 21, 2007 5:25 am

Fix for MSWindows batch scripts (and paths w/spaces)

Postby NVRAM » Sat Aug 25, 2007 9:00 pm

Okay, I've been reading about the problems people have been having on MSW when putting files under C:\Program Files, or other locations with spaces in the filename.

I thought this should be simple to fix, so I put leJOS 0.3.0alpha on an MSW-XP machine, changed the nxj*.bat files and it all seems to work just fine with spaces in the filenames and environment variables.

In each of the nxj*.bat files, I made two changes (where applicable):
1. I replaced the parameter list (%1 %2 %3 %4 %5 %6 %7 %8 %9) with a percent sign and an asterisk (%*),
2. I removed double quotes from any SET lines, since cmd.exe doesn't need them and will add these as part of variable itself.

I didn't try downloading the firmware again, but did use nxjc, nxj, nxj -r and nxjbrowse -- all without problem. Environment settings were:

Code: Select all

set NXJ_HOME=C:\Program Files\lejos_nxj
set JAVA_HOME=C:\Program Files\Java\Jdk1.6.0_02
set PATH=%PATH%;%NXJ_HOME%\bin;%JAVA_HOME%\bin

I'm not sure what nxjlink is supposed to do, it ran, but spewed unprintable things (literally) all over my screen.

Can someone else try this and see if my fix works for them also?

Happy Haquing,

New User
Posts: 22
Joined: Sun Aug 12, 2007 2:22 am

Postby jvance » Sun Aug 26, 2007 12:00 am

Hi, I tried out what you suggested on nxjc.bat script.

@echo off
if "%NXJ_HOME%" == "" goto homeless

javac -source 1.3 -target 1.1 -bootclasspath "%NXJ_HOME%\lib\classes.jar;%CLASSPATH%" %*
goto end

echo NXJ_HOME not defined


Is this what it is supposed to look like?

User avatar
Site Admin
Posts: 392
Joined: Fri Aug 04, 2006 4:03 pm

Postby bbagnall » Sun Aug 26, 2007 5:23 pm

Thanks, I made the changes to the code. I'm not sure if the %* change makes a difference, though, but I guess it is more economical.

Return to “NXJ Software”

Who is online

Users browsing this forum: No registered users and 4 guests