The input line is too long - Windows command line error

Today I wanted to run the bat file shown below to run a java program. This file is mainly used to set the classpath as you can see below.

@echo off
setlocal

set BROKER_HOME=C:/Documents and Settings/user/workspace/myProject

set CP=%BROKER_HOME%/out/lib/activation-1.0.2.jar;%CP%
set CP=%BROKER_HOME%/out/lib/activeio-2.1.jar;%CP%
set CP=%BROKER_HOME%/out/lib/axis.jar;%CP%
set CP=%BROKER_HOME%/out/lib/axis.ns.jar;%CP%
set CP=%BROKER_HOME%/out/lib/axis.org.jar;%CP%
set CP=%BROKER_HOME%/out/lib/axis-ant.jar;%CP%
set CP=%BROKER_HOME%/out/lib/connector.jar;%CP%
set CP=%BROKER_HOME%/out/lib/csv.jar;%CP%
set CP=%BROKER_HOME%/out/lib/csvman.jar;%CP%
set CP=%BROKER_HOME%/out/lib/jakarta-oro-2.0.8.jar;%CP%
set CP=%BROKER_HOME%/out/lib/jaxrpc.jar;%CP%
set CP=%BROKER_HOME%/out/lib/jmxri-1.2.jar;%CP%
set CP=%BROKER_HOME%/out/lib/jmxtools-1.2.jar;%CP%
set CP=%BROKER_HOME%/out/lib/log4j-1.2.8.jar;%CP%
set CP=%BROKER_HOME%/out/lib/mail.jar;%CP%
set CP=%BROKER_HOME%/out/lib/mule/backport-util-concurrent-3.0.jar;%CP%
set CP=%BROKER_HOME%/out/lib/mule/commons-beanutils-1.7.0.jar;%CP%
set CP=%BROKER_HOME%/out/lib/mule/commons-codec-1.3.jar;%CP%
set CP=%BROKER_HOME%/out/lib/mule/commons-collections-3.2.jar;%CP%
set CP=%BROKER_HOME%/out/lib/mule/commons-digester-1.7.jar;%CP%
set CP=%BROKER_HOME%/out/lib/mule/commons-discovery-0.2.jar;%CP%
set CP=%BROKER_HOME%/out/lib/mule/commons-httpclient-3.0.1.jar;%CP%
set CP=%BROKER_HOME%/out/lib/mule/commons-jxpath-1.2.jar;%CP%
set CP=%BROKER_HOME%/out/lib/mule/commons-logging-1.0.4.jar;%CP%
set CP=%BROKER_HOME%/out/lib/mule/commons-net-1.4.1.jar;%CP%
set CP=%BROKER_HOME%/out/lib/mule/commons-pool-1.3.jar;%CP%
set CP=%BROKER_HOME%/out/lib/mule/dom4j-1.4.jar;%CP%
set CP=%BROKER_HOME%/out/lib/mule/jug-2.0.0-asl.jar;%CP%
set CP=%BROKER_HOME%/out/lib/mule/mule-core-1.3.2.jar;%CP%
set CP=%BROKER_HOME%/out/lib/mule/mule-module-acegi-1.3.2.jar;%CP%
set CP=%BROKER_HOME%/out/lib/mule/mule-module-builders-1.3.2.jar;%CP%
set CP=%BROKER_HOME%/out/lib/mule/mule-module-client-1.3.2.jar;%CP%
set CP=%BROKER_HOME%/out/lib/mule/mule-module-management-1.3.2.jar;%CP%
set CP=%BROKER_HOME%/out/lib/mule/mule-module-ognl-1.3.2.jar;%CP%
set CP=%BROKER_HOME%/out/lib/mule/mule-module-pgp-1.3.2.jar;%CP%
set CP=%BROKER_HOME%/out/lib/mule/mule-module-scripting-1.3.2.jar;%CP%
set CP=%BROKER_HOME%/out/lib/mule/mule-module-spring-1.3.2.jar;%CP%
set CP=%BROKER_HOME%/out/lib/mule/mule-module-xml-1.3.2.jar;%CP%
set CP=%BROKER_HOME%/out/lib/mule/mule-transport-ejb-1.3.2.jar;%CP%
set CP=%BROKER_HOME%/out/lib/mule/mule-transport-email-1.3.2.jar;%CP%
set CP=%BROKER_HOME%/out/lib/mule/mule-transport-file-1.3.2.jar;%CP%
set CP=%BROKER_HOME%/out/lib/mule/mule-transport-ftp-1.3.2.jar;%CP%
set CP=%BROKER_HOME%/out/lib/mule/mule-transport-http-1.3.2.jar;%CP%
set CP=%BROKER_HOME%/out/lib/mule/mule-transport-jbi-1.3.2.jar;%CP%
set CP=%BROKER_HOME%/out/lib/mule/mule-transport-jdbc-1.3.2.jar;%CP%
set CP=%BROKER_HOME%/out/lib/mule/mule-transport-jms-1.3.2.jar;%CP%
set CP=%BROKER_HOME%/out/lib/mule/mule-transport-multicast-1.3.2.jar;%CP%
set CP=%BROKER_HOME%/out/lib/mule/mule-transport-quartz-1.3.2.jar;%CP%
set CP=%BROKER_HOME%/out/lib/mule/mule-transport-rmi-1.3.2.jar;%CP%
set CP=%BROKER_HOME%/out/lib/mule/mule-transport-soap-1.3.2.jar;%CP%
set CP=%BROKER_HOME%/out/lib/mule/mule-transport-ssl-1.3.2.jar;%CP%
set CP=%BROKER_HOME%/out/lib/mule/mule-transport-stream-1.3.2.jar;%CP%
set CP=%BROKER_HOME%/out/lib/mule/mule-transport-tcp-1.3.2.jar;%CP%
set CP=%BROKER_HOME%/out/lib/mule/mule-transport-udp-1.3.2.jar;%CP%
set CP=%BROKER_HOME%/out/lib/mule/mule-transport-vm-1.3.2.jar;%CP%
set CP=%BROKER_HOME%/out/lib/mule/mule-transport-xfire-1.3.2.jar;%CP%
set CP=%BROKER_HOME%/out/lib/mule/mule-transport-xmpp-1.3.2.jar;%CP%
set CP=%BROKER_HOME%/out/lib/mule/mx4j-impl-2.1.1.jar;%CP%
set CP=%BROKER_HOME%/out/lib/mule/mx4j-jmx-2.1.1.jar;%CP%
set CP=%BROKER_HOME%/out/lib/mule/mx4j-remote-2.1.1.jar;%CP%
set CP=%BROKER_HOME%/out/lib/mule/mx4j-tools-2.1.1.jar;%CP%
set CP=%BROKER_HOME%/out/lib/mule/ognl-2.6.9.jar;%CP%
set CP=%BROKER_HOME%/out/lib/mule/xpp3_min-1.1.3.4.O.jar;%CP%
set CP=%BROKER_HOME%/out/lib/mule/xstream-1.2.1.jar;%CP%
set CP=%BROKER_HOME%/out/lib/muleOpt/commons-attributes-api-2.1.jar;%CP%
set CP=%BROKER_HOME%/out/lib/muleOpt/commons-dbutils-1.0.jar;%CP%
set CP=%BROKER_HOME%/out/lib/muleOpt/commons-io-1.2.jar;%CP%
set CP=%BROKER_HOME%/out/lib/muleOpt/commons-lang-2.2.jar;%CP%
set CP=%BROKER_HOME%/out/lib/muleOpt/geronimo-j2ee-connector_1.5_spec-1.0.1.jar;%CP%
set CP=%BROKER_HOME%/out/lib/muleOpt/geronimo-jta_1.0.1B_spec-1.0.1.jar;%CP%
set CP=%BROKER_HOME%/out/lib/netsuite-2.0.0.jar;%CP%
set CP=%BROKER_HOME%/out/lib/ojdbc14.jar;%CP%
set CP=%BROKER_HOME%/out/lib/quartz-1.4.0.jar;%CP%
set CP=%BROKER_HOME%/out/lib/saaj.jar;%CP%
set CP=%BROKER_HOME%/out/lib/spring-beans.jar;%CP%
set CP=%BROKER_HOME%/out/lib/spring-context.jar;%CP%
set CP=%BROKER_HOME%/out/lib/spring-core.jar;%CP%
set CP=%BROKER_HOME%/out/lib/wsdl4j-1.5.1.jar;%CP%
set CP=%BROKER_HOME%/out/conf;%CP%
set CP=%BROKER_HOME%/lib/commons-dbutils-1.0.jar;%CP%
set CP=./;%CP%
set CP="%CP%"

ECHO Using Classpath:
ECHO %CP%

cd ..

java -classpath %CP% com.mycompany.myproject.Client

An error message resulted saying "Input line is too long" as shown in the image. This is not an error in the java program which you would guess first.



I have set up a variable for classpath which makes my command too lengthy. This message pops up since the command is too long for the Windows® command line environment to handle.

The number of characters that can be entered into a single command is limited to 8191. (this is including spaces).

For example total number of charaters in the below command is 42.
C:\>javac -classpath myclasses.jar Client.java

There was no solution to the issue other than somehow making the classpath shorter by moving the jar files into a folder like "C:\jars".

Do you have any other solutions for this issue?

Margin Vs Padding - CSS Properties


CSS provides two properties named margin and padding for keeping space between HTML Box type elements. But why do we have two properties for the same reason? Are they similar?
No. They have a main difference.
Padding - defines space between border and element content
Margin - defines space between border and other outer elements
(Look at the above diagram)

So when elements needs space between them, better to use margins. When text or an inner element needs space between the parent box and itself go for paddings.

Look at this example for visual clarification generated with this code.
<div style="margin:25px; background:#cccccc; border:#000000 2px dashed;">
Text inside element
</div>
<div style="padding:25px; background:#cccccc; border:#000000 2px dashed;">
Text inside element
</div>


Text inside element

Text inside element



In the first <div>, space is set between the border and outside elements but in the second one it is between the boder and text.

Hope this will help.

Setting Java classpath option with spaces and quotes under Windows®

Java provides two methods for setting paths of the classes.
1. Set the command line option classpath
2. Set the CLASSPATH environment variable

The second option is easy, but has a draw back as a common CLASSPATH is shared within all the projects and classes, which makes it harder to test different projects with different classes.

So the first option is the prefered way. It is used as;
java -classpath first.jar;second.jar TestClient


When the paths to the jar files have spaces, the command line classpath option causes errors. Under Windows installation like 2000/NT/XP, all the users get a folder with the user name under a folder named "Documents and Settings" (which has a space). And if the jar files are under the user folder, path would look like "C:/Documents and Settings/someUser/.." which would cause the above error.

How to over come this issue
1. Put quotes and group the whole class path
java -classpath "C:/Documents and Settings/user/project/lib/axis.jar; C:/Documents and Settings/user/project/lib/axis-ant.jar;" TestClient

2. Put quotes on individual paths
java -classpath "C:/Documents and Settings/user/project/lib/axis.jar"; "C:/Documents and Settings/user/project/lib/axis-ant.jar;" TestClient

Do not complain on what you haven't got

As human beings we always tend to complain on what we haven't got. Many people forget to appreciate the things that they have received; even they forget that they have so much to appreciate on their living status than looking at the negative sides.



For example think how you feel when your (expensive) meals are little less tasty than how it used to be. You get so annoyed, right?

Have a look at the images as they tell a lot on the above topic.





See how much you are fortunate to have this type of a life (even having a chance to have access to computers to do internet surfing while some people do not have a chance to get a drop of water.

(I have no idea on who is the owner of these images, but thanks for the nice images).

Change of "My day time world"


Yes, I said "My day time world". The company I'm working always becomes my day time world, but there are sometimes I happend to make it "My full day world" when project deadlines are getting closer.

Hey all, now I'm in a new company as I left the previous one after 2 1/2 years of experience there. It's about 1 1/2 months now in my new world. I could not do any blogging after I joined here, not because my new company do restrict it, since I had to do some home work and put extra time and effort to get to the speed on the new projects and all that.

Now I'm planning to spend some time here as well. So don't forget to come back often.

My BASIC? Your BASIC? Tiny BASIC?

Not infrequently people will post questions in our community forums (http://libertybasic.conforums.com and http://groups.yahoo.com/group/libertybasic) asking how to implement a programming language. Usually someone will chime in with a link to some very detailed tutorials hundreds of pages long. This is fine if the reader is sufficiently well motivated.

The other day I stumbled on a very cool page on Wikipedia about Tiny BASIC, a language implemented many years ago and published in the seminal Dr. Dobbs Journal magazine. I realized that budding language implementors would really go bonkers for this!

http://en.wikipedia.org/wiki/Tiny_Basic

Check out the links at the bottom. There are a couple of implementations there written in BASIC with source code. What better way to get your feet wet but to port Tiny BASIC to Liberty BASIC or to your favorite BASIC? Doing the port shouldn't be too hard, and you'll learn enough to venture adding some new commands. :-)

Check out this stream