dkim18
asked on
run.bat file
I am having weird error. I am passing two args when I run this program.
args[1] is: http://webdev.apl.jhu.edu/%7Emed/summer03/homework/05LibrarySwing.html
However, when I put this url in run.bat file like this:
java <program> <path> http://webdev.apl.jhu.edu/%7Emed/summer03/homework/05LibrarySwing.html
args[1] comes into main without "%7", and that is why my program doesn't work.
Another word, System.out.println("args[1 ] " + args[1] ); just print http://webdev.apl.jhu.edu/Emed/summer03/homework/05LibrarySwing.html
Of course, run.bat file is excutable file.
Why is that?
-----------------
public static void main(String[] args) throws CrawlerException {
checkUsage(args);
//final String LINE_SEPARATOR = System.getProperty("line.s eparator") ;
//StringBuffer buffy = new StringBuffer("");
try{
System.out.println("args[1 ] " + args[1] );
URL url = new URL(args[1]);
args[1] is: http://webdev.apl.jhu.edu/%7Emed/summer03/homework/05LibrarySwing.html
However, when I put this url in run.bat file like this:
java <program> <path> http://webdev.apl.jhu.edu/%7Emed/summer03/homework/05LibrarySwing.html
args[1] comes into main without "%7", and that is why my program doesn't work.
Another word, System.out.println("args[1
Of course, run.bat file is excutable file.
Why is that?
-----------------
public static void main(String[] args) throws CrawlerException {
checkUsage(args);
//final String LINE_SEPARATOR = System.getProperty("line.s
//StringBuffer buffy = new StringBuffer("");
try{
System.out.println("args[1
URL url = new URL(args[1]);
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
What platform are you running? For Win it works fine without escaping...
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
To escape the percent in a batch file, you type %%. Just the percent character twice.
and thats why i said to escape since windows should not take it as a its own operator and treat it as a special character.
Ah, yeah, well done Breadstick! I launched it directly from command line without batch-file...
Regards!
Regards!