This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: HELP: java path and classpath question


My suggestion is a simple patch and recompile to cygwin.  There
is a file called environ.cc.  It contains the code that
automaticly converts variables like PATH and HOME to cygwinformat
when it enters cygwin, and back when it leaves.

All you have to do is add the code preceded by the plus signs code right after
the path entry, on about line 50 of the file:


 static win_env conv_envvars[] =
   {
     {"PATH=", 5, NULL, NULL, cygwin_win32_to_posix_path_list,
      cygwin_posix_to_win32_path_list,
      cygwin_win32_to_posix_path_list_buf_size,
      cygwin_posix_to_win32_path_list_buf_size},
+     {"CLASSPATH=", 10, NULL, NULL, cygwin_win32_to_posix_path_list,
+      cygwin_posix_to_win32_path_list,
+      cygwin_win32_to_posix_path_list_buf_size,
+      cygwin_posix_to_win32_path_list_buf_size},
     {"HOME=", 5, NULL, NULL, cygwin_conv_to_full_posix_path, cygwin_conv_to_full_win32_path,
     return_MAX_PATH, return_MAX_PATH},
    {"LD_LIBRARY_PATH=", 16, NULL, NULL, cygwin_conv_to_full_posix_path,
     cygwin_conv_to_full_win32_path, return_MAX_PATH, return_MAX_PATH},
    {"TMPDIR=", 7, NULL, NULL, cygwin_conv_to_full_posix_path, cygwin_conv_to_full_win32_path,
     return_MAX_PATH, return_MAX_PATH},
    {"TMP=", 4, NULL, NULL, cygwin_conv_to_full_posix_path, cygwin_conv_to_full_win32_path,
     return_MAX_PATH, return_MAX_PATH},
    {"TEMP=", 5, NULL, NULL, cygwin_conv_to_full_posix_path, cygwin_conv_to_full_win32_path,
     return_MAX_PATH, return_MAX_PATH},
    {NULL, 0, NULL, NULL, NULL, NULL, 0, 0}
  };


Note that I just cut and pasted the entry for PATH, and changed the word PATH to CLASSPATH, and the number 5 following ( which is the length, including the equals sign) to 10.  If you want to add other variables, feel free.  I compile using vc++, so I added the INCLUDES and LIBS variables as well.

I have tried to get them to include this patch, or even better to make the
environment processing configurable, but to no avail.  :(


On Mon, Feb 11, 2002 at 04:09:39PM -0800, Randall R Schulz wrote:
> Wally,
> 
> Unless a program has been ported to and compiled with Cygwin headers and 
> libraries it is a Windows program and knows nothing of POSIX (Unix-style) 
> file names and PATH (-type) variables. Cygwin programs will understand both 
> kinds of arguments. To be more precise, the Cygwin libraries take either 
> kind of file name, but a program that was only minimally ported to Cygwin 
> might make its own assumptions about what a file name looks like, and could 
> misinterpret a Windows-style name.
> 
> The Java tools from Sun have _not_ been ported to Cygwin, and hence you 
> must supply arguments in the Windows format.
> 
> Good luck.
> 
> Randy
> 
> 
> At 14:39 2002-02-11, you wrote:
> >He Randall, thanks a lot for the message.
> >
> >The java compiler I am using is called generic java (with extended utility 
> >classes, see http://www.research.avayalabs.com/user/wadler/pizza/gj/and 
> >http://developer.java.sun.com/developer/earlyAccess/adding_generics/).
> >
> >
> >those environment variables and alias are set in .bashrc. "gjc" is 
> >supposed to compile java source files containing templates into stardard 
> >class files.
> >
> >I am confused with cygwin- and window-style paths. A simple question is 
> >which style to use in order to invoke window java vm, and if window-style 
> >path is the one to be used, how to put it in a file like .bashrc.
> >
> >Thanks again.
> 
> 
> --
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> Bug reporting:         http://cygwin.com/bugs.html
> Documentation:         http://cygwin.com/docs.html
> FAQ:                   http://cygwin.com/faq/
> 

-- 
Got freedom?  Vote Libertarian:  http://www.lp.org

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]