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: Java for Cygwin


I do all my Java development under Cygwin.	You are probably seeing a
classpath issue.  My solution was to make the following change to
environ.cc in the cygwin sources:  This allows me to set the
classpath and such in a shell script to a reasonable value,
without having to jump through any cygpath hoops.  Just for what
it's worth.

BTW, the first part is just #defines because I couldn't bring
myself to type all the stuff you need for a variable.  Eventually,
I'd like to come up with a patch to allow the user to specify
environment variables for translation, but I haven't had time to
finish that yet.

The only thing you really need for java is classpath.  The others
I added are INCLUDE and LIB (msvc++), and PYTHONPATH (omniorb).

Rich

This patch is hereby placed into the public domain.  Anyone who
wants it can have it.

 - - - - - - - - - - - - - - CUT HERE - - - - - - - - - - - - - - - 
Index: environ.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/environ.cc,v
retrieving revision 1.78
diff -u -r1.78 environ.cc
--- environ.cc	21 Jun 2002 05:01:16 -0000	1.78
+++ environ.cc	24 Jun 2002 05:23:36 -0000
@@ -46,6 +46,29 @@
	  <= CYGWIN_VERSION_DLL_MALLOC_ENV)
 
 #define NL(x) x, (sizeof (x) - 1)
+#define LIST_CONV(x) \
+	{ \
+		x##"=",\
+		sizeof(x),\
+		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\
+	}
+#define PATH_CONV(x) \
+	 { \
+		x##"=",\
+		sizeof(x),\
+		NULL,\
+		NULL,\
+		cygwin_conv_to_full_posix_path,\
+		cygwin_conv_to_full_win32_path,\
+		return_MAX_PATH,\
+		return_MAX_PATH \
+	}
+	
 /* List of names which are converted from dos to unix
	on the way in and back again on the way out.
 
@@ -55,20 +78,16 @@
 static int return_MAX_PATH (const char *) {return MAX_PATH;}
 static NO_COPY win_env conv_envvars[] =
   {
-	 {NL ("PATH="), 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},
-	 {NL ("HOME="), NULL, NULL, cygwin_conv_to_full_posix_path,
-	  cygwin_conv_to_full_win32_path, return_MAX_PATH, return_MAX_PATH},
-	 {NL ("LD_LIBRARY_PATH="), NULL, NULL, cygwin_conv_to_full_posix_path,
-	  cygwin_conv_to_full_win32_path, return_MAX_PATH, return_MAX_PATH},
-	 {NL ("TMPDIR="), NULL, NULL, cygwin_conv_to_full_posix_path,
-	  cygwin_conv_to_full_win32_path, return_MAX_PATH, return_MAX_PATH},
-	 {NL ("TMP="), NULL, NULL, cygwin_conv_to_full_posix_path,
-	  cygwin_conv_to_full_win32_path, return_MAX_PATH, return_MAX_PATH},
-	 {NL ("TEMP="), NULL, NULL, cygwin_conv_to_full_posix_path,
-	  cygwin_conv_to_full_win32_path, return_MAX_PATH, return_MAX_PATH},
+	 LIST_CONV("PATH"),
+	 PATH_CONV("HOME"),
+	 LIST_CONV("LD_LIBRARY_PATH"),
+	 PATH_CONV("TMPDIR"),
+	 PATH_CONV("TMP"),
+	 PATH_CONV("TEMP"),
+	LIST_CONV("INCLUDE"),
+	LIST_CONV("LIB"),
+	LIST_CONV("CLASSPATH"),
+	LIST_CONV("PYTHONPATH"),
	 {NULL, 0, NULL, NULL, NULL, NULL, 0, 0}
   };
 - - - - - - - - - - - - - - CUT HERE - - - - - - - - - - - - - - - 
 
On Fri, Jun 21, 2002 at 07:20:45PM +0200, Istvan Kurucz (ETH) wrote:
> Hi,
> 
> I've been using Cygwin for a long time but I'm not able to run Java
> applications. I always got error message "Exception in thread "main"
> java.lang.NoClassDefFoundError:". It's seems to me there is no path
> for Java JNI.
> 
> Can someone help me?
> 
> BR/Istvan, 
> 
> --
> 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]