delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/06/24/02:02:38

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Mon, 24 Jun 2002 01:38:57 -0400
From: rich-paul AT rich-paul DOT net
To: cygwin AT cygwin DOT com
Subject: Re: Java for Cygwin
Message-ID: <20020624013857.C7238@monster.rich-paul.net>
References: <F005CD411D18D3119C8F00508B0874800514CCA5 AT ehubunt100 DOT eth DOT ericsson DOT se>
Mime-Version: 1.0
User-Agent: Mutt/1.3.16i
In-Reply-To: <F005CD411D18D3119C8F00508B0874800514CCA5@ehubunt100.eth.ericsson.se>; from Istvan.Kurucz@eth.ericsson.se on Fri, Jun 21, 2002 at 07:20:45PM +0200
X-Operating-System: Linux monster 2.4.17-SMPs

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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019