* Apache Tomcat / Tomcat based apps @ 2006-05-21 14:33 Christopher Molnar 2006-05-21 14:51 ` Brian Dessent 2006-05-21 16:04 ` Igor Peshansky 0 siblings, 2 replies; 9+ messages in thread From: Christopher Molnar @ 2006-05-21 14:33 UTC (permalink / raw) To: cygwin-apps Hello, A few weeks back I posted a message asking for some direction on contributing to Cygwin by maintaining Apache Tomcat and a few other tomcat based applications. A few people responded and suggested that I look at gcj as the possible compiler to use as it is already in Cygwin. I have spent the last few weeks trying to get this to work with no success. I would like to find out if it is possible to create a dependency in a package on the sun java sdk. For example the default install of Java 1.5 from Sun uses a home directory of: "/cygdrive/c/Program\ Files/Java/jdk1.5.0_06" , so keying on the presence of that directory is a good bet Java is installed with the correct version. Suggestions? Comments? Thanks, -Chris ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Apache Tomcat / Tomcat based apps 2006-05-21 14:33 Apache Tomcat / Tomcat based apps Christopher Molnar @ 2006-05-21 14:51 ` Brian Dessent 2006-05-21 15:26 ` Christopher Molnar 2006-05-21 16:04 ` Igor Peshansky 1 sibling, 1 reply; 9+ messages in thread From: Brian Dessent @ 2006-05-21 14:51 UTC (permalink / raw) To: cygwin-apps Christopher Molnar wrote: > "/cygdrive/c/Program\ Files/Java/jdk1.5.0_06" , so keying on the > presence of that directory is a good bet Java is installed with the > correct version. No, that's not a good bet at all. That directory is only spelled "Program Files" in the English localization. In other versions of windows it defaults to "\Archivos de programa", "\Programme", and so on. It could be on any drive letter. Or the user might have chosen something else entirely like "z:\foobar". And not everyone has their cygdrive prefix set to "/cygdrive" either. You can't make any such kind of assumption about paths whatsoever. Brian ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Apache Tomcat / Tomcat based apps 2006-05-21 14:51 ` Brian Dessent @ 2006-05-21 15:26 ` Christopher Molnar 0 siblings, 0 replies; 9+ messages in thread From: Christopher Molnar @ 2006-05-21 15:26 UTC (permalink / raw) To: cygwin-apps OK, understand. Now I need to ask the question.. Do you have any ideas how I can make this work? Maybe a package that the user selects if java is on the machine? Again, I am trying to deal with the problem and not having much luck. Thanks, -Chris Brian Dessent wrote: > Christopher Molnar wrote: > >> "/cygdrive/c/Program\ Files/Java/jdk1.5.0_06" , so keying on the >> presence of that directory is a good bet Java is installed with the >> correct version. > > No, that's not a good bet at all. That directory is only spelled > "Program Files" in the English localization. In other versions of > windows it defaults to "\Archivos de programa", "\Programme", and so > on. It could be on any drive letter. Or the user might have chosen > something else entirely like "z:\foobar". And not everyone has their > cygdrive prefix set to "/cygdrive" either. You can't make any such kind > of assumption about paths whatsoever. ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Apache Tomcat / Tomcat based apps 2006-05-21 14:33 Apache Tomcat / Tomcat based apps Christopher Molnar 2006-05-21 14:51 ` Brian Dessent @ 2006-05-21 16:04 ` Igor Peshansky 2006-05-21 20:06 ` Joshua Daniel Franklin 1 sibling, 1 reply; 9+ messages in thread From: Igor Peshansky @ 2006-05-21 16:04 UTC (permalink / raw) To: Christopher Molnar; +Cc: cygwin-apps On Sun, 21 May 2006, Christopher Molnar wrote: > Hello, > > A few weeks back I posted a message asking for some direction on > contributing to Cygwin by maintaining Apache Tomcat and a few other > tomcat based applications. A few people responded and suggested that I > look at gcj as the possible compiler to use as it is already in Cygwin. > > I have spent the last few weeks trying to get this to work with no > success. I would like to find out if it is possible to create a > dependency in a package on the sun java sdk. For example the default > install of Java 1.5 from Sun uses a home directory of: > "/cygdrive/c/Program\ Files/Java/jdk1.5.0_06" , so keying on the > presence of that directory is a good bet Java is installed with the > correct version. > > Suggestions? Comments? You can have a configuration script that contains a path to the Java SDK, which the users can edit, and install it from a default location if not present. As long as the only thing in that script is the Java SDK location, you should never have to replace it on installation. Sure, the package won't work OOTB, but configuration is as easy as putting one path in, say, /etc/tomcat.java.cfg (invent the name, there isn't a standard one). This also might be a good time to plug my java wrapper scripts in the cygwin-apps repository. They started out exactly along the lines of what you've been thinking (i.e., a hard-coded user-editable path), but my latest improvement that I've just committed uses the $JAVA_HOME setting to detect the installation. This works with both IBM and Sun JDKs (1.4.2 and 1.5.0 are the ones I've tested). I usually make symlinks in /usr/local/bin to the scripts in the local CVS copy. Check them out: <http://cygwin.com/cgi-bin/cvsweb.cgi/wrappers/java/?cvsroot=cygwin-apps>. I do intend to package them as a Cygwin package at some point soon. Comments and suggestions welcome. Igor -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_ pechtcha@cs.nyu.edu | igor@watson.ibm.com ZZZzz /,`.-'`' -. ;-;;,_ Igor Peshansky, Ph.D. (name changed!) |,4- ) )-,_. ,\ ( `'-' old name: Igor Pechtchanski '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow! "Las! je suis sot... -Mais non, tu ne l'es pas, puisque tu t'en rends compte." "But no -- you are no fool; you call yourself a fool, there's proof enough in that!" -- Rostand, "Cyrano de Bergerac" ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Apache Tomcat / Tomcat based apps 2006-05-21 16:04 ` Igor Peshansky @ 2006-05-21 20:06 ` Joshua Daniel Franklin 2006-05-21 21:47 ` Igor Peshansky 2006-05-22 7:40 ` John Morrison 0 siblings, 2 replies; 9+ messages in thread From: Joshua Daniel Franklin @ 2006-05-21 20:06 UTC (permalink / raw) To: cygwin-apps > On Sun, 21 May 2006, Christopher Molnar wrote: > > I would like to find out if it is possible to create a > > dependency in a package on the sun java sdk. For example the default > > install of Java 1.5 from Sun uses a home directory of: > > "/cygdrive/c/Program\ Files/Java/jdk1.5.0_06" , so keying on the > > presence of that directory is a good bet Java is installed with the > > correct version. On 5/21/06, Igor Peshansky wrote: > You can have a configuration script that contains a path to the Java SDK, > which the users can edit, and install it from a default location if not > present. As long as the only thing in that script is the Java SDK > location, you should never have to replace it on installation. Sure, the > package won't work OOTB, but configuration is as easy as putting one path > in, say, /etc/tomcat.java.cfg (invent the name, there isn't a standard > one). I haven't been using Java on Cygwin, but I follow it fairly closely on Red Hat Enterprise and Fedora mailing lists. The emerging "standard" way of doing things there is with the JPackage.org layout, which heavily uses the alternatives system to set up useful JAVA_HOME variables and /usr/bin/java{,c} and if desired to easily switch between several JVMs (Sun, IBM, even GJC or Kaffe). There are some helper scripts in a jpackage-utils package; the original from JPackage.org uses RPMs, but Debian and Ubuntu have adopted the overall framework with DEBs so my guess would be that making Cygwin packages with the same methods would work too. They have a lot of Java apps packaged in a FHS-compliant way, including Eclipse and Tomcat (and the config file if you want to change for example JAVA_OPTS for Tomcat5 is /etc/tomcat5/tomcat5.conf ). From what I remember of Igor's scripts, they basically act like this java-compat RPM: http://jpackage.org/rpm.php?id=3319 which creates symlinks to a preexisting JVM install. (BTW: they know their website is ugly.) See also the Ubuntu package: http://packages.ubuntulinux.org/dapper/utils/jpackage-utils Or, maybe that's all too complicated. :) ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Apache Tomcat / Tomcat based apps 2006-05-21 20:06 ` Joshua Daniel Franklin @ 2006-05-21 21:47 ` Igor Peshansky 2006-05-21 23:01 ` Christopher Molnar 2006-05-22 7:40 ` John Morrison 1 sibling, 1 reply; 9+ messages in thread From: Igor Peshansky @ 2006-05-21 21:47 UTC (permalink / raw) To: Joshua Daniel Franklin; +Cc: cygwin-apps On Sun, 21 May 2006, Joshua Daniel Franklin wrote: > > On Sun, 21 May 2006, Christopher Molnar wrote: > > > I would like to find out if it is possible to create a dependency in > > > a package on the sun java sdk. For example the default install of > > > Java 1.5 from Sun uses a home directory of: "/cygdrive/c/Program\ > > > Files/Java/jdk1.5.0_06" , so keying on the presence of that > > > directory is a good bet Java is installed with the correct version. > > On 5/21/06, Igor Peshansky wrote: > > You can have a configuration script that contains a path to the Java > > SDK, which the users can edit, and install it from a default location > > if not present. As long as the only thing in that script is the Java > > SDK location, you should never have to replace it on installation. > > Sure, the package won't work OOTB, but configuration is as easy as > > putting one path in, say, /etc/tomcat.java.cfg (invent the name, there > > isn't a standard one). > > I haven't been using Java on Cygwin, but I follow it fairly closely on > Red Hat Enterprise and Fedora mailing lists. The emerging "standard" way > of doing things there is with the JPackage.org layout, which heavily > uses the alternatives system to set up useful JAVA_HOME variables and > /usr/bin/java{,c} and if desired to easily switch between several JVMs > (Sun, IBM, even GJC or Kaffe). There are some helper scripts in a > jpackage-utils package; the original from JPackage.org uses RPMs, but > Debian and Ubuntu have adopted the overall framework with DEBs so my > guess would be that making Cygwin packages with the same methods would > work too. The problem with using this method on Cygwin is that the executables (or symlinks) in /usr/bin won't understand Cygwin paths, etc. > They have a lot of Java apps packaged in a FHS-compliant way, including > Eclipse and Tomcat (and the config file if you want to change for > example JAVA_OPTS for Tomcat5 is /etc/tomcat5/tomcat5.conf ). From what > I remember of Igor's scripts, they basically act like this java-compat > RPM: http://jpackage.org/rpm.php?id=3319 which creates symlinks to a > preexisting JVM install. (BTW: they know their website is ugly.) See > also the Ubuntu package: > http://packages.ubuntulinux.org/dapper/utils/jpackage-utils > > Or, maybe that's all too complicated. :) My wrapper scripts do a bit more than that -- they also translate the arguments containing paths appropriately, before eventually invoking the right executables. The part that dispatches based on JAVA_HOME is not the main point of the scripts, though it's nice to have. Igor -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_ pechtcha@cs.nyu.edu | igor@watson.ibm.com ZZZzz /,`.-'`' -. ;-;;,_ Igor Peshansky, Ph.D. (name changed!) |,4- ) )-,_. ,\ ( `'-' old name: Igor Pechtchanski '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow! "Las! je suis sot... -Mais non, tu ne l'es pas, puisque tu t'en rends compte." "But no -- you are no fool; you call yourself a fool, there's proof enough in that!" -- Rostand, "Cyrano de Bergerac" ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Apache Tomcat / Tomcat based apps 2006-05-21 21:47 ` Igor Peshansky @ 2006-05-21 23:01 ` Christopher Molnar 2006-05-22 3:51 ` Igor Peshansky 0 siblings, 1 reply; 9+ messages in thread From: Christopher Molnar @ 2006-05-21 23:01 UTC (permalink / raw) To: cygwin-apps So if I follow your java.sh script correctly and get the idea, I could call this at the start of the startup.sh script which needs the location of JAVA_HOME and it would find the correct jdk location? or does it just find the java.exe? I would need it to find JAVA_HOME and set that variable .... If I am thinking this through correctly. I also need this for the build scripts for ANT and TOMCAT. -Chris Igor Peshansky wrote: > > My wrapper scripts do a bit more than that -- they also translate the > arguments containing paths appropriately, before eventually invoking the > right executables. The part that dispatches based on JAVA_HOME is not the > main point of the scripts, though it's nice to have. > Igor ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Apache Tomcat / Tomcat based apps 2006-05-21 23:01 ` Christopher Molnar @ 2006-05-22 3:51 ` Igor Peshansky 0 siblings, 0 replies; 9+ messages in thread From: Igor Peshansky @ 2006-05-22 3:51 UTC (permalink / raw) To: Christopher Molnar; +Cc: cygwin-apps Ugh, top-posting... Reformatted. On Sun, 21 May 2006, Christopher Molnar wrote: > Igor Peshansky wrote: > > > My wrapper scripts do a bit more than that -- they also translate the > > arguments containing paths appropriately, before eventually invoking > > the right executables. The part that dispatches based on JAVA_HOME is > > not the main point of the scripts, though it's nice to have. > > Igor > > So if I follow your java.sh script correctly and get the idea, I could > call this at the start of the startup.sh script which needs the location > of JAVA_HOME and it would find the correct jdk location? or does it just > find the java.exe? Well, JAVA_HOME is expected to already point to the correct JDK location. And you would simply invoke the appropriate wrapper for each program (e.g., invoke "java" to find "java.exe", "jar" to find "jar.exe", etc). The wrappers will "help" those JDK programs understand Cygwin paths, etc. Their intent was to help non-Cygwin-aware Unix scripts that invoke java and other JDK executables. > I would need it to find JAVA_HOME and set that variable .... If I am > thinking this through correctly. One of the future work items in the wrappers is the logic (which would most likely go into a /etc/profile.d script) to find some Java installation automatically and set JAVA_HOME if it's not already set. But this is obviously not done yet. > I also need this for the build scripts for ANT and TOMCAT. I'm not very familiar with the Tomcat build procedure, but, IIRC, my wrappers will not be very helpful for Ant, as its build scripts understand the JAVA_HOME setting, are Cygwin-aware, and do the appropriate path conversion themselves (so the wrappers never get invoked -- Ant invokes java.exe directly). Igor -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_ pechtcha@cs.nyu.edu | igor@watson.ibm.com ZZZzz /,`.-'`' -. ;-;;,_ Igor Peshansky, Ph.D. (name changed!) |,4- ) )-,_. ,\ ( `'-' old name: Igor Pechtchanski '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow! "Las! je suis sot... -Mais non, tu ne l'es pas, puisque tu t'en rends compte." "But no -- you are no fool; you call yourself a fool, there's proof enough in that!" -- Rostand, "Cyrano de Bergerac" ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Apache Tomcat / Tomcat based apps 2006-05-21 20:06 ` Joshua Daniel Franklin 2006-05-21 21:47 ` Igor Peshansky @ 2006-05-22 7:40 ` John Morrison 1 sibling, 0 replies; 9+ messages in thread From: John Morrison @ 2006-05-22 7:40 UTC (permalink / raw) To: cygwin-apps On Sun, May 21, 2006 9:06 pm, Joshua Daniel Franklin wrote: >> On Sun, 21 May 2006, Christopher Molnar wrote: >> > I would like to find out if it is possible to create a >> > dependency in a package on the sun java sdk. For example the default >> > install of Java 1.5 from Sun uses a home directory of: >> > "/cygdrive/c/Program\ Files/Java/jdk1.5.0_06" , so keying on the >> > presence of that directory is a good bet Java is installed with the >> > correct version. There's always the registry key... JAVA_SDK_VERSION=`cat /proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java\ Development\ Kit/CurrentVersion` JAVA_JRE_VERSION=`cat /proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java\ Runtime\ Environment/CurrentVersion` export JAVA_HOME=`cat /proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java\ Development\ Kit/${JAVA_JRE_VERSION}/JavaHome` export PATH=$PATH:$JAVA_HOME/bin used to work for me (I don't have Java installed atm (new machine)). J. ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2006-05-22 7:40 UTC | newest] Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2006-05-21 14:33 Apache Tomcat / Tomcat based apps Christopher Molnar 2006-05-21 14:51 ` Brian Dessent 2006-05-21 15:26 ` Christopher Molnar 2006-05-21 16:04 ` Igor Peshansky 2006-05-21 20:06 ` Joshua Daniel Franklin 2006-05-21 21:47 ` Igor Peshansky 2006-05-21 23:01 ` Christopher Molnar 2006-05-22 3:51 ` Igor Peshansky 2006-05-22 7:40 ` John Morrison
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).