Some people say that their path is too long, However, the problem is often caused by recurring call of the same batch script with code like set mypath=%mypath%;appendix
. People just do not realize that. I proposed a solution to restore the env variables upon exit
set old_path=classpath
set classpath=%classpath%;appendix
java myApp
set classpath=old_path
But it is tedious and error prone. I may easily forget to recover or fail due to exception, another exit path. Can this be done automatically?
We can start with a smart appendix. I mean that the problem is caused by appending the path unconditionally. You already have the appendix on your path but add it over and over again. That is the root of the problem. I think that the same problem applies to bash. Might be I can check the path and add only those entries which are missing? What is the standard solution?