Re: Optimal Directory Structure?
>I realize that there is not one answer to this question but I would like >some of you veteran java/linux developers to suggest what the optimal >directory structure and setup of the CLASSPATH variable is. > >I am, frankly, a C++ programmer trying to learn java and I am >continually frustrated over the myriad ways I can be foobared by >CLASSPATH. And then packages on top of that. > I personally use a little shell script which I name 'd' (for develop), and that looks like: # script for setting up development environment # changes for using postgresql PATH=$PATH:/usr/local/pgsql/bin MANPATH=$MANPATH:/usr/local/pgsql/man PGDATA=/usr/local/pgsql/data PGLIB=/usr/local/pgsql/lib POSTGRES_HOME=/usr/local/pgsql # don't forget to add hosts to /usr/local/pgsql/data/pg_hba.conf export MANPATH PGDATA PGLIB POSTGRES_HOME # changes for using java PATH=.:$PATH:/usr/local/jdk1.1.6/bin CLASSPATH=.:/usr/local/jdk1.1.6/lib/classes.zip # changes for using the JDBC driver of postgresql # add the directory where postgresql.jar resides CLASSPATH=$CLASSPATH:/usr/local/pgsql/lib/postgresql.jar #changes for using the swing release CLASSPATH=$CLASSPATH:/usr/local/swing-1.0.3/swingall.jar #CLASSPATH=$CLASSPATH:/usr/local/swing-1.1beta/swingall.jar #changes for JavaPureCheck CLASSPATH=$CLASSPATH:/usr/local/jpc/javapurecheck.jar # for project CLASSPATH=$CLASSPATH:/usr/src/project cd /usr/src/project export PATH CLASSPATH Some explanation: 1. You must invoke this script on your command line (in an x-terminal) . d (dot, followed by space, followed by d) to execute the script in the current shell (else the settings in this script are only valid for a new shell that immediately ends). 2. Replace /usr/src/project with your source directory for your application. 3. You could put the content of this script also in your .bash_profile but I find it cleaner to use a separate script that I can modify and re-execute using . d 4. The section changes for using java points adds to the classpath the classes.zip of your favourite JDK. 5. The section labeled "changes for using swing" is there because I use swing as my GUI class library. Notice that by simply commenting in and out you can switch between swing-1.0.3 and swing-1.1beta2 6. The section labeled "changes for using JDBC driver" is there because I am making an entreprise Java application using the postgresql database engine. 7. The section labeled "changes for using JavaPureCheck" is there because I regularly check if my code is 100% pure java. 8. Make shure that the 'd' script is in a directory where your PATH can find it. Personally I add to my .bash_profile a directory called /usr/src/develop where I put my d script. Hope this helps, regards Wim Ceulemans
Re: Optimal Directory Structure?
Wim Ceulemans wrote: > I personally use a little shell script which I name 'd' (for develop), and > that looks like: > > # script for setting up development environment > PATH=$PATH:/usr/local/pgsql/bin >... Come to think of it, I use that technique, too- but my little script sets up the environment absolutely, without appending to the old variables, so I can run it to fix up a corrupted environment or to switch JDK's. (This may be more important on WinNT/95/MS-DOS, though, where my day job is, because the environment is so fragile there.) - Dan
Change the titlebar (and the subject line damnit!) (was: Java 1.1.6 can't add!)
Maarten van Leunen <[EMAIL PROTECTED]> writes: > A small thing: > > Whenever I give my Java APplication a nice name in the Titlebar, it says > in the titlebar "No Name". I see this on Solaris running twm. But whenever I use fvwm anywhere, the window title shows up fine. -- [If you post a response, no need to cc me; if you cc me, please say so.] "An old dog can't learn new tricks."
jserv problem
Of those of you who have successfully gotten the mod_jserv.o apached module to work -- help! I've rebuilt apache (1.3.1), and built the jserv classes successfully. After configuring apache I get: [elohim:/usr/local/jserv0.9.11/classes]# tail -n 1 /var/log/httpd/servlet_error Can't find class org.apache.jserv.JServHandler in my servlet error file repeated over and over even though the classpath is set. What am I missing? Below are is the jserv config for apache and a find on the directory where the jserv classes are. thanks, todd [excerpt from httpd.conf] # jserv - Java Servlet Module configuration ServletClassPath /usr/local/jdk1.1.6/lib/classes.zip ServletClassPath /usr/local/jserv0.9.11/servclasses.zip ServletClassPath /usr/local/jserv0.9.11/classes # mod_jserv ServletErrorLog /var/log/httpd/servlet_error ServletAlias /jsdkServlets /usr/local/jserv0.9.11/JSDK2.0/examples ServletAlias /servlets /home/httpd/servlets [elohim:/usr/local/jserv0.9.11/classes]# find . -print . ./org ./org/apache ./org/apache/jserv ./org/apache/jserv/JServConnection.class ./org/apache/jserv/JServConnection$JServInputStream.class ./org/apache/jserv/JServConnection$JServOutputStream.class ./org/apache/jserv/JServSendError.class ./org/apache/jserv/JServServletManager.class ./org/apache/jserv/JServContext.class ./org/apache/jserv/JServSession.class ./org/apache/jserv/JServHandler.class ./org/apache/jserv/JServHandler$1.class ./org/apache/jserv/JServSignals.class ./org/apache/jserv/JServUtils.class ./org/apache/jserv/JServLock.class ./org/apache/jserv/JServLock$TimeoutException.class ./org/apache/jserv/JServClassLoader.class ./org/apache/jserv/JServClassLoader$ClassCacheEntry.class ./org/apache/jserv/SGMLTag.class ./org/apache/jserv/test ./org/apache/jserv/test/BadClassTest.class ./org/apache/jserv/test/ClassLoaderTest.class ./org/apache/jserv/test/ServletMonitor.class ./org/apache/jserv/test/LoadClassTest.class =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- A magazine ran a Dilbert quotes contest. These are actual quotes from managers out there. What I need is a list of specific unknown problems we will encounter. Todd Palmer Developer [EMAIL PROTECTED] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Re: Optimal Directory Structure?
Steve Cohen wrote: > I realize that there is not one answer to this question but I would like > some of you veteran java/linux developers to suggest what the optimal > directory structure and setup of the CLASSPATH variable is. >... > I know it isn't rocket science, but it is annoying. What I am looking > for is a strategy. I want to be able to set it one way and forget about > it, at least until the next project. For me, the best way to deal with it is explicitly. I use Sun's JDK, and everything I do looks kinda like this: every compile or execution is driven by a shell script (or batch file) that starts off with something like MYJDK=/usr/local/jdk1.1.6 MYCLASSPATH=.:$MYJDK/lib/classes.zip and then java -classpath $MYCLASSPATH ... In other words, the classpath is completely specified each time I run java or javac. No more mysteries. - Dan
javacomm ioctl help
[EMAIL PROTECTED] writes: > I am trying to add hardware handshaking to the RXTX package and am > having lots of troubles with the java environment. I have a routine in C > that handles hardware handshaking without any problems. However, > incorporating this routine into java with JNI causes all sorts of > strange problem. i.e a call to tcgetattr works immediately after turning > h/w handshaking off, however when this routine is called again I get an > IO error on the tcgetattr call, just trying to read the damn status! > Somehow jumping fro the C code back into java and back again stuffs up > the port somehow. Anyone have any ideas > > What the hell does the java do to the machine since I can't even open a > port non_blocking under java!! The ports are already nonblocking! Greeen threads makes every file descriptor that gets created be put into nonblocking mode. It does this by interposing on system calls like open, and forcing the fd to be attributed appropriately (i.e. nonblocking, and registered with the interrupt system so that SIGIO's are delivered). You have basically two choices: a) Ignore trying to make the fd nonblocking. b) (preferred) -- use the "internal" libc open() call (__open) yourself. same for read, write, select, and some others that I don't think are relevant. If you can #define open in your code to be __open, and similarly for the other system calls that you need to issue (to be on the safe side, I think you could #define all system and c library calls that you make to be the __ variant). Steve
Java-Linux
Günter Zell writes: > Steve Byrne , > > I got your e-mail address from a Linux-Usergroup. > Iám looking for a JDK-Port for Linux. > Can you give me a hint > from where I can get one ? www.blackdown.org We're just about to release 1.1.6v4a...you might want to wait a day or so before downloading ... v4a is *much* better than the earlier members of the 1.1.6 release -- it's worth the wait! Steve
Re: javacomm ioctl help
Steve Byrne wrote: > [DELETED] > ...It does this by interposing on > system calls like open, and forcing the fd to be attributed appropriately > (i.e. nonblocking, and registered with the interrupt system so that SIGIO's > are delivered). > > You have basically two choices: > > a) Ignore trying to make the fd nonblocking. > b) (preferred) -- use the "internal" libc open() call (__open) yourself. >same for read, write, select, and some others that I don't think >are relevant. If you can #define open in your code to be __open, and >similarly for the other system calls that you need to issue (to be >on the safe side, I think you could #define all system and c library >calls that you make to be the __ variant). > This may explain problems I had with timers on RPC calls via JNI. Do you suggest any way to have the RPC library calling the native "__"-prefixed functions from the RPC library (which I can't modify)? Or without perusing the sources, is there any docs on changes, say, to alarm() and signal processing? -- Diego Pons
