Reading (All) Environment Variables in W95/NT
I am getting some requests from NT users on an application that I wrote on
a Java/Linux environment. I have a Java application that runs fine on Unix
and I am trying to get to run perfectly on NT. I have a run time shell
script that passes the entire environment to the JVM using a system
property.
java -Denv=`env` xenon.xsql.editor.Xsql
The env produces the multiline environment variables list that we know and
love. On running the application the program looks for the value of system
property called `env'. Hence the JVM gets the entire environment. I have
source code that breaks down the multiline value and cuts out each variable
definition like `HOME=/home/peterp'. The definition is further split into a
name and value (`HOME' and `/home/peterp') and then place stored in the
system properties as renamed property `env.HOME' and `/home/peterp'. In
short all the environment variable are prepended with `env.'. Using this
hand-me-down old deprecated source code from an unknown URL, I can write
code like this:
String imagesDir=System.getProperty("env.IMAGES_DIR");
String searchPath=System.getProperty("env.JAVAFILESEARCHPATH");
Of course this does not work with Windows NT (or 95/98). I am not an expert
on NT. I do not think there is an equivalent for `env' under NT.
Is there such thing ?
Of course I could write a work around that involve just passing a limited
number of properties to JVM in a NT batch command `.BAT' file.
java -DIMAGES_DIR=%IMAGES_DIR% ... xenon.sql.editor.Xsql
Admittedly the full final code would look terrible ugly. I am clueless if
the DOS? W95/NT Shell allows long character lines. Can you even do `back
subtitution' using the W95/NT shell is also quite another thing as well?
Also when I tried extending my `PATH' under W95 I got `out of environment
space' or something?
However do any other java-linuxers know of a better solution or API?
Any help receives my grateful kudos.
Pete
Re: JDBC-connection in Linux
On Sat, 12 Dec 1998, Christopher Hinds wrote: >>Try WebLogic's , they have multiple Type 4 (and Type 2) JDBC Drivers >for most of production comercial DBMSs > www.weblogic.com > >They may be free , in any event they do offer eval licenses Not free. We evaluated it with reference to connecting to MS SQLServer, as the JDBC-ODBC bridge didn't cut it, and it did seem extremely solid and complete (more so than PostGreSQL anyway), but it turns out to be *extremely* expensive - especially as you go to "enterprise" capabilities (below which it's number-of-connections-limited). -- Rachel Greenham Epinet Communications plc
Re: VAJava 4 Linux petition is still on!!!
On Sun, 13 Dec 1998, Jauvane Cavalcante de Oliveira wrote: >I just received a messge letting me know that the petition asking IBM to >release a version of VAJava is still collecting signatures and will soon >be forwarded to IBM. So, if you did not sign it already and you would >like to have such development environment for Linux (as well as an >indirect support from IBM) I would suggest you to sign it up and >increase the 700 mark already reached :-D. > >The URL is http://www.jguru.com/thetick/visualage/tips. follow the >"petition" link. I'd love to, but this URL doesn't respond. -- Rachel Greenham Epinet Communications plc
Re: Reading (All) Environment Variables in W95/NT
Try something like this in your NT/95 startup script (smth like this
must work also on linux/bash with changing \ to /, %% to $, del to rm
and doing smth with :s and ;s in multiple paths in environment):
set >%TMP%\env
java -Denv.file=%TMP%\env ...
del %TMP%\env
and then in your code:
Properties p = new Properties();
p.load(new FileInputStream(System.getProperty("env.file")); //
Hope this helps.
All the Best
Pavel
[EMAIL PROTECTED] wrote:
>
> I am getting some requests from NT users on an application that I wrote on
> a Java/Linux environment. I have a Java application that runs fine on Unix
> and I am trying to get to run perfectly on NT. I have a run time shell
> script that passes the entire environment to the JVM using a system
> property.
>
> java -Denv=`env` xenon.xsql.editor.Xsql
>
> The env produces the multiline environment variables list that we know and
> love. On running the application the program looks for the value of system
> property called `env'. Hence the JVM gets the entire environment. I have
> source code that breaks down the multiline value and cuts out each variable
> definition like `HOME=/home/peterp'. The definition is further split into a
> name and value (`HOME' and `/home/peterp') and then place stored in the
> system properties as renamed property `env.HOME' and `/home/peterp'. In
> short all the environment variable are prepended with `env.'. Using this
> hand-me-down old deprecated source code from an unknown URL, I can write
> code like this:
>
> String imagesDir=System.getProperty("env.IMAGES_DIR");
> String searchPath=System.getProperty("env.JAVAFILESEARCHPATH");
>
>
> Of course this does not work with Windows NT (or 95/98). I am not an expert
> on NT. I do not think there is an equivalent for `env' under NT.
> Is there such thing ?
>
> Of course I could write a work around that involve just passing a limited
> number of properties to JVM in a NT batch command `.BAT' file.
>
> java -DIMAGES_DIR=%IMAGES_DIR% ... xenon.sql.editor.Xsql
>
> Admittedly the full final code would look terrible ugly. I am clueless if
> the DOS? W95/NT Shell allows long character lines. Can you even do `back
> subtitution' using the W95/NT shell is also quite another thing as well?
> Also when I tried extending my `PATH' under W95 I got `out of environment
> space' or something?
>
> However do any other java-linuxers know of a better solution or API?
>
> Any help receives my grateful kudos.
>
> Pete
Re: Reading (All) Environment Variables in W95/NT
I think a small setup program that generates this default property file maybe the answer too. I am thinking of a simple JTable name and value. Am not sure if I follow you. Do you mean that I should set this in my application. Because then we have a chicken and egg scenario. I want to use the properties to define where the application gets resources for images, audio, HTML files. It is also impossible to have access to all possible platforms. What is needed is portable and customisable way of setting up default properties per user per machine. Something that work on non-UNIX machines as well. Pete __ Reply Separator _ Subject: Re: Reading (All) Environment Variables in W95/NT Author: Gerrit.Cap ([EMAIL PROTECTED]) at lon-mime Date:14/12/98 11:49 There is a port available of a lot of unix commands for NT called the MKS toolkit, look for more info on www.mks.com. There are even some public domain ports but MKS is a low cost and good investment. On the other hand, if you want to make your software platform independant I would stick around with basic java functionalities. So what I would do is to use in your java program a self defined properties file and read it through the Properties.load method. And out of your program build for each platform a way to generate that properties file. This can than be done on all platforms you want to run your applications on. There are platforms (eg Macintosh) where there is to my knowledge no environment available. Gerrit. At 09:58 AM 12/14/98 +, you wrote: >I am getting some requests from NT users on an application that I wrote on >a Java/Linux environment. I have a Java application that runs fine on Unix >and I am trying to get to run perfectly on NT. I have a run time shell >script that passes the entire environment to the JVM using a system >property. > >java -Denv=`env` xenon.xsql.editor.Xsql >
Re: Reading (All) Environment Variables in W95/NT
Thanks well I found my copy of jikes which has a `jd.bat' file:
pilgpe@poppy [58] > c jikes-1.11/jd.bat
@echo off
rem Set JD and JDK to match the appropriate installation directories on
your system.
rem
set JD=c:\derek\jbin\jd.zip
set JDK=c:\java\lib\classes.zip
rem
echo on
java -nojit -classpath %JD%;%JDK% jd.Main -nojit -classpath
%JD%;%CLASSPATH%;%JDK% %1 %2 %3 %4 %5 %6 %7 %8 %9
After reading this batch file than I realised immediatelyt that getting
software to run on different architecture is another chestnut (problem).
I guess not every Operating system will provide a batch or scripting
language! (Well I think the Macintosh does not have one. Does it? )
Pete
__ Reply Separator _
Subject: Re: Reading (All) Environment Variables in W95/NT
Author: paul ([EMAIL PROTECTED]) at lon-mime
Date:14/12/98 12:00
Try something like this in your NT/95 startup script (smth like this
must work also on linux/bash with changing \ to /, %% to $, del to rm
and doing smth with :s and ;s in multiple paths in environment):
set >%TMP%\env
java -Denv.file=%TMP%\env ...
del %TMP%\env
and then in your code:
Properties p = new Properties();
p.load(new FileInputStream(System.getProperty("env.file")); //
Hope this helps.
All the Best
Pavel
[EMAIL PROTECTED] wrote:
>
> I am getting some requests from NT users on an application that I wrote on
> a Java/Linux environment. I have a Java application that runs fine on Unix
> and I am trying to get to run perfectly on NT. I have a run time shell
> script that passes the entire environment to the JVM using a system
> property.
>
> java -Denv=`env` xenon.xsql.editor.Xsql
>
Re: Java 1.2
I asked this question a month ago and did not get a single response. So I'm assuming one of two possibilities: either Sun has virtually taken over the porting of Java2 to Linux and the Blackdown developers are being hush hush about it for some unknown reason, OR, everybody's just too busy and nothing's really happening. Either way, I've gone ahead and applied for a source license with Sun because I'm interested in Java2 for Linux on the Netwinder and I'm feel pretty sure nobody else is doing that. However, it would be nice to get some info about any potholes I have to look forward to. Is anybody listening? Hello... Michael Privat wrote: > > Hi, > I realise you probably get this question ten thousand times a day, > but is there a Java v1.2 porting project ? Is there any approximation > about when it would be available ? > > Thanks a lot, > Michael Privat > > --- > Michael Privat > Massachusetts Institute of Technology > CECI - Advanced Artificial Intelligence - ALIVE Project > ---
Re: VAJava 4 Linux petition is still on!!!
So, do I. But this URL does not respond. Jacques Chansavang IBM Global Services [EMAIL PROTECTED] Phone: (219)455-6234 >>> Rachel Greenham 12/14 6:34 AM >>> On Sun, 13 Dec 1998, Jauvane Cavalcante de Oliveira wrote: >I just received a messge letting me know that the petition asking IBM to >release a version of VAJava is still collecting signatures and will soon >be forwarded to IBM. So, if you did not sign it already and you would >like to have such development environment for Linux (as well as an >indirect support from IBM) I would suggest you to sign it up and >increase the 700 mark already reached :-D. > >The URL is http://www.jguru.com/thetick/visualage/tips. follow the >"petition" link. I'd love to, but this URL doesn't respond. -- Rachel Greenham Epinet Communications plc
Re: Killing Applets in browsers
On Sun, 13 Dec 1998, Leo Cyr wrote: > If you use HotJava (current is 1.1.5) for some reason ;-) it automatically > re-downloads the classes/jars specified in the Applet tag. I'm not sure why > -- I guess it is realted to the browser's cache, but caching of html is > still on... It just works... > > Christopher Hinds wrote: > > > Since the browser caches HTML pages in a history list of some type, > > every > > you time leave and return to the HTML page, the applet will be activated > > ( start() ) and deactivated ( stop() ) respectively. Therefore you can > > try clearing the cached pages which should force the embedded JVM > > to call the destroy() on the applet. Or you can uses JavaScript to > > clear the browser cached history > > list if the browser supports JavaScript. > > > > Cheers > > Chris > > > > Thor Erik Karlsen wrote: > > > > > This is a proplem that has been irritating me since the day I started > > > developing applets(not that long ago). Is there a WORKING way an > > > applet can destroy itself and tell the browser that its dead? I always > > > have to start the browser again and reload the applet during > > > development. Destroy() dont work. What im looking for is some code > > > within the applet that solves the problem once for all. Thor Erik > > > Karlsen > > > Catalyst ONE AS > > > [EMAIL PROTECTED] afaik the applet can't do it, but the user CAN. With netscape, hold the shift key down while clicking "reload." Or use the appletviewer. -- Cheers John Summerfield http://os2.ami.com.au/os2/ for OS/2 support. Configuration, networking, combined IBM ftpsites index.
Re: JDBC-connection in Linux
Sorry all, I recievied a eval copy at JavaOne in March of this year and at that time they where free and very solid in terms of performance and reliabilty( even type 4, I never usded their JDBC-ODBC bridge). :-< Cheers Chris Rachel Greenham wrote: On Sat, 12 Dec 1998, Christopher Hinds wrote: >>Try WebLogic's , they have multiple Type 4 (and Type 2) JDBC Drivers >for most of production comercial DBMSs > www.weblogic.com > >They may be free , in any event they do offer eval licenses Not free. We evaluated it with reference to connecting to MS SQLServer, as the JDBC-ODBC bridge didn't cut it, and it did seem extremely solid and complete (more so than PostGreSQL anyway), but it turns out to be *extremely* expensive - especially as you go to "enterprise" capabilities (below which it's number-of-connections-limited). -- Rachel Greenham Epinet Communications plc
Re: Java 1.2
I don't know if I missed something, but it looks like the FAQ has been updated. -jj- -- -BEGIN PGP PUBLIC KEY BLOCK- Version: 2.3 mQCNAi0lY4sAAAEEAPR4vyny2WCxVe4gW7u+zPT2fH6vFTwMxAoBOrrUn92aGKJr ronHVYMbSO9CwBK3F1KKi+IGB/SxkjH7x2j/b7HiwHjKb+mkDa+lA6eOh9x8A7dJ 55be0mOMF+W9FLDdIgK/RDLFoqi8icv2P0pLCPdMirnNhtNRfLR2WhStnLNVAAUR tAhUaGVTaGFkbw== =z55x -END PGP PUBLIC KEY BLOCK-
Java Booster
Hi there people... Can someone tell me where I can find any Java performance booster for linux? thanx. Tobias Ramos Diamantina MG [EMAIL PROTECTED]
Re: Java Booster
TYA1.2 ftp://gonzalez.cyberus.ca/pub/Linux/java Tobias Ramos wrote: > Hi there people... > > Can someone tell me where I can find any Java performance booster for > linux? > > thanx. > > Tobias Ramos > Diamantina MG > [EMAIL PROTECTED]
VAJava petition...
The petition site is back online. Goto http://www.jguru.com/thetick/visualage/tips/ and chose the "Petition" link at the end... JVc.
Re: Problems with Threads (Code included)
Hi, I attached my Cliente.java
I have 2 threads: Receptor and Transmisor. Receptor sends and receives
data from server, using method recibirPeticion(), forever (well, it sleeps
3 seconds). When Transmisor sends data, using method enviarPeticion(),
Receptor must wait until Transmisor ends his transmition.
I get
java.lang.IllegalMonitorStateException: current thread not owner
What's wrong?
Thanks!
Carlos
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.InetAddress;
import java.net.Socket;
import java.net.UnknownHostException;
public class Cliente implements Runnable
{
static String respuesta="0";
static Socket socket=null;
static PrintWriter out=null;
static BufferedReader in=null;
static Thread receptor;
static Thread transmisor;
static String host=null;
static boolean indicador=false;
public static void main(String args[])
{
new Cliente();
}
public Cliente()
{
if(true)
{
try
{
host="132.248.59.4";
socket=new Socket(InetAddress.getByName(host),);
System.out.println("Creando hilo Receptor");
receptor=new Thread(this,"Receptor");
System.out.println("Creando hilo Transmisor");
transmisor=new Thread(this,"Transmisor");
receptor.start();
transmisor.start();
}
catch(UnknownHostException e)
{
System.err.println("Host desconocido: "+host);
System.exit(1);
}
catch(IOException e)
{
System.err.println("Error de Entrada/Salida con: "+host);
System.exit(1);
}
}
}
public void run()
{
while(true)
{
if(Thread.currentThread().getName().equals("Receptor"))
recibirPeticion();
else if(Thread.currentThread().getName().equals("Transmisor"))
enviarPeticion();
}
}
public synchronized static void recibirPeticion()
{
System.out.println("Iniciando Receptor");
try
{
while(indicador==true)
{
System.out.println("Deteniendo hilo Receptor");
Thread.currentThread().wait();
System.out.println("Continuando hilo Receptor");
}
System.out.println("Receptor recibe estado de la sala");
out=new PrintWriter(socket.getOutputStream(),true);
out.println("recibir");
in=new BufferedReader(new InputStreamReader(socket.getInputStream()));
respuesta=in.readLine();
System.out.println("La respuesta del Servidor es: "+respuesta);
Thread.sleep(3000);
}
catch(Exception e)
{
System.out.println("Paso algo con el servidor: "+host);
e.printStackTrace();
}
}
public synchronized static void enviarPeticion()
{
indicador=true;
System.out.println("Iniciando Transmisor");
try
{
out=new PrintWriter(socket.getOutputStream(),true);
System.out.println("El usuario carlos aparto una computadora");
out.println("enviar");
out.println("carlos");
out.println("15");
out.println("21:00");
out.println("50");
}
catch(IOException e)
{
System.err.println("Error de Entrada/Salida con: "+host);
e.printStackTrace();
}
indicador=false;
System.out.println("Notificando...");
Thread.currentThread().notifyAll();
}
}
Re: Problems with Threads (Code included)
Carlos,
Your problem is with Thread.currentThread().wait()/notifyAll(). Since your method is
synchronized, you own the monitor for "this", not the monitor for currentThread()
(every object has its own monitor).
Try removing "Thread.currentThread()." and leaving just the "wait()/notifyAll()"
calls, and see if it does what you want. If you want to grab the monitor for some
other object, instead of synchronizing the whole method you can use a synchronized
block:
synchronized (anObject) {
// ... blah blah blah
anObject.notifyAll()
}
Hope this helps,
-Mario Camou.
Carlos Alberto Roman Zamitiz wrote:
> Hi, I attached my Cliente.java
> I have 2 threads: Receptor and Transmisor. Receptor sends and receives
> data from server, using method recibirPeticion(), forever (well, it sleeps
> 3 seconds). When Transmisor sends data, using method enviarPeticion(),
> Receptor must wait until Transmisor ends his transmition.
>
> I get
> java.lang.IllegalMonitorStateException: current thread not owner
>
> What's wrong?
>
> Thanks!
>
> Carlos
>
>
> import java.io.BufferedReader;
> import java.io.PrintWriter;
> import java.io.IOException;
> import java.io.InputStreamReader;
> import java.net.InetAddress;
> import java.net.Socket;
> import java.net.UnknownHostException;
>
> public class Cliente implements Runnable
> {
> static String respuesta="0";
> static Socket socket=null;
> static PrintWriter out=null;
> static BufferedReader in=null;
> static Thread receptor;
> static Thread transmisor;
> static String host=null;
> static boolean indicador=false;
>
> public static void main(String args[])
> {
> new Cliente();
> }
>
> public Cliente()
> {
> if(true)
> {
>try
>{
> host="132.248.59.4";
> socket=new Socket(InetAddress.getByName(host),);
> System.out.println("Creando hilo Receptor");
> receptor=new Thread(this,"Receptor");
> System.out.println("Creando hilo Transmisor");
> transmisor=new Thread(this,"Transmisor");
> receptor.start();
> transmisor.start();
>}
>catch(UnknownHostException e)
>{
> System.err.println("Host desconocido: "+host);
> System.exit(1);
>}
>catch(IOException e)
>{
> System.err.println("Error de Entrada/Salida con: "+host);
> System.exit(1);
>}
> }
> }
>
> public void run()
> {
> while(true)
> {
>if(Thread.currentThread().getName().equals("Receptor"))
> recibirPeticion();
>else if(Thread.currentThread().getName().equals("Transmisor"))
> enviarPeticion();
> }
> }
>
> public synchronized static void recibirPeticion()
> {
> System.out.println("Iniciando Receptor");
> try
> {
>while(indicador==true)
>{
> System.out.println("Deteniendo hilo Receptor");
> Thread.currentThread().wait();
> System.out.println("Continuando hilo Receptor");
>}
>System.out.println("Receptor recibe estado de la sala");
>out=new PrintWriter(socket.getOutputStream(),true);
>out.println("recibir");
>in=new BufferedReader(new InputStreamReader(socket.getInputStream()));
>respuesta=in.readLine();
>System.out.println("La respuesta del Servidor es: "+respuesta);
>Thread.sleep(3000);
> }
> catch(Exception e)
> {
>System.out.println("Paso algo con el servidor: "+host);
>e.printStackTrace();
> }
> }
>
> public synchronized static void enviarPeticion()
> {
> indicador=true;
> System.out.println("Iniciando Transmisor");
> try
> {
>out=new PrintWriter(socket.getOutputStream(),true);
>System.out.println("El usuario carlos aparto una computadora");
>out.println("enviar");
>out.println("carlos");
>out.println("15");
>out.println("21:00");
>out.println("50");
> }
> catch(IOException e)
> {
>System.err.println("Error de Entrada/Salida con: "+host);
>e.printStackTrace();
> }
> indicador=false;
> System.out.println("Notificando...");
> Thread.currentThread().notifyAll();
> }
> }
Problem with TYA 1.2
Hi, I just installed TYA 1.2. My code used to work perfectly with previous versions, now I get a thread dump. Intel Pentium Kernel 2.0.36 JDK 1.1.7v1a Red Hat 5.1 with all updates applied There's also a weird "user programm switched off JIT compiling" message. This behavior is completely reproducible (happens every time). Here's what I get: TYA 1.2 (for J117 / Linux). Copyright (c) 1997,98 The TYA Team Contact The TYA Team via Albrecht Kleine <[EMAIL PROTECTED]> TYA: 74087 byte for java/text/resources/LocaleElements.getContents (()[[Ljava/lang/Object;) TYA: 19766 byte for COM/Umbral/via/applet/ViaApplication. ((Ljava/lang/String;)V) TYA: *** user programm switched off JIT compiling *** TYA:EXCEPTIONS_BY_SIGNALS problem *** panic: TYA:EXCEPTIONS_BY_SIGNALS problem TYA: Signal 6, returning to default handler; SIGABRT 6* abort (generated by abort(3) routine) stackbase=0xb770, stackpointer=0xbfffe7c8 Full thread dump: "Finalizer thread" (TID:0x40659210, sys_thread_t:0x4139de0c, state:CW) prio=1 "Async Garbage Collector" (TID:0x40659258, sys_thread_t:0x4137ce0c, state:R) prio=1 "Idle thread" (TID:0x406592a0, sys_thread_t:0x4135be0c, state:R) prio=0 "Clock" (TID:0x40659088, sys_thread_t:0x4133ae0c, state:CW) prio=12 "main" (TID:0x406590b0, sys_thread_t:0x81f79f8, state:R) prio=5 *current thread* javax.swing.UIManager.initialize(Compiled Code) javax.swing.UIManager.maybeInitialize(Compiled Code) javax.swing.UIManager.getUI(Compiled Code) javax.swing.JPanel.updateUI(Compiled Code) javax.swing.JPanel.(Compiled Code) javax.swing.JPanel.(Compiled Code) javax.swing.JRootPane.createGlassPane(Compiled Code) javax.swing.JFrame.createRootPane(Compiled Code) javax.swing.JFrame.frameInit(Compiled Code) javax.swing.JFrame.(Compiled Code) COM.Umbral.via.applet.ViaApplication.(Compiled Code) COM.Umbral.via.applet.ViaApplication.main(Compiled Code) Monitor Cache Dump: (0x0x4137ce0c): owner "Async Garbage Collector" (0x4137ce0c, 1 entry) java.lang.Class@1080449672/1080920280: owner "main" (0x81f79f8, 2 entries) Registered Monitor Dump: Thread queue lock: Name and type hash table lock: String intern lock: JNI pinning lock: JNI global reference lock: BinClass lock: Class loading lock: Java stack lock: Code rewrite lock: Heap lock: Has finalization queue lock: Finalize me queue lock: Waiting to be notified: "Finalizer thread" (0x4139de0c) Dynamic loading lock: Monitor IO lock: Child death monitor: Event monitor: I/O monitor: Alarm monitor: Waiting to be notified: "Clock" (0x4133ae0c) Monitor registry: owner "main" (0x81f79f8, 1 entry) Thread Alarm Q:
list
unsubscribe list *
Re: Problems with Threads (Code included)
> Mario Camou writes: Mario> Carlos, Mario> Your problem is with Mario> Thread.currentThread().wait()/notifyAll(). Since your Mario> method is synchronized, you own the monitor for "this", not No. Since the the methods are 'synchronized' and 'static', he owns the monitor for 'Cliente.class' Juergen -- Juergen Kreileder, Universitaet Dortmund, Lehrstuhl Informatik V Baroper Strasse 301, D-44221 Dortmund, Germany Phone: ++49 231/755-5806, Fax: ++49 231/755-5802
Which optimizations does the javac compiler do?
I noticed the -O flag of the javac compiler. What are the optimizations that the javac usually does? Which ones are activated by the -O flag? I tried the -O flag in my n-body distributed computing java application, but the performance was worse than without the -O flag. --- Andrea "Kontorotsui" Controzzi - MALE Student of Computer Science at University of Pisa - Italy - E-mail: [EMAIL PROTECTED] My home page: http://www.cli.di.unipi.it/~controzz/intro.html Founder and Admiral of Hoshi no Senshi (italian Leiji Matsumoto's fan group). Creator of It.Arti.Cartoni (italian anime newsgroup) and proud member of... +-+ |. * . | | .__ . . | |oq |po _ _| | / #==>>>==#,-' (_)\ | | | ,-|~\\ ///_ ,() ,_} | | | |/|~]]] /// ,-~' .,~ / \| . | | |\_|_|_\_\~~~~' \ (/|. | | ./~ \___/ [m] \ \__// | | _bo..__ // `-,.~~ | | _-~ 0o.__( . | | \ o . | | . (_)00 | |. \~~~*,,,* ~00 | |~0 . | | ~~~---~~ | | .*| +-+
Re: Problem with TYA 1.2
On Mon, 14 Dec 1998, Mario Camou wrote: > I just installed TYA 1.2. My code used to work perfectly with previous versions, > now I get a thread dump. > > There's also a weird "user programm switched off JIT compiling" message. It appears that the jvm is calling a method that switches off the jit compiler. If you compile tya w/ I belive something like IGNORE_DISABLE defined in tya.c it worked for me. jason
Linux Red Hat ethernet driver
Hi- Sorry if this is the wrong list, but... I'm installing Red Hat Linux 5.2 on a Compaq. The ethernet driver, tlan.o, for this machine is copied to the file system. But Red Hat's install program doesn't list it amongst its drivers from which to select. I have the file, but don't know how to "install" it manually. Its name is tlan.o and is in the directory with all the other ethernet drivers. This is probably really easy, but I'm stumped, Dan
list/mail
I don't want to receive any more mail.What can I do to unsubscribe from this list?
Re: Problem with TYA 1.2
Jason and Mark, Thanx for your quick replies! Uncommenting the "#define IGNORE_DISABLE" in tya.c did it. What I'd like to know (I'm really curious!) is exactly WHAT is trying to turn off the JIT. Could it be Swing? Also, Mark told me that this had been covered a few days ago in this list. Sorry then for the wasted bandwidth, I completely missed it. And to the Blackdown and TYA teams, you guys are doing a Great Job! Thank you so much! -Mario. On Mon, 14 Dec 1998, Mario Camou wrote: > I just installed TYA 1.2. My code used to work perfectly with previous versions, > now I get a thread dump. > > There's also a weird "user programm switched off JIT compiling" message.
Re: Problem with TYA 1.2
Mario Camou wrote:
> Jason and Mark,
>
> Thanx for your quick replies! Uncommenting the "#define IGNORE_DISABLE" in tya.c did
> it. What I'd like to know (I'm really curious!) is exactly WHAT is trying to turn off
> the JIT. Could it be Swing?
Swing 1.1 tries to disable the JIT during some huge initialization
methods that are only
executed once - presumably it is
faster to just interpret these methods rather than having the overhead
of JIT
compilation.
Here is the snippet of code from Swing 1.1b3 (in javax/swing/UIDefaults)
:
private static void initialize()
{
Properties swingProps = loadSwingProperties();
try {
// We discourage the JIT during UI initialization.
// JITing here tends to be counter-productive.
java.lang.Compiler.disable();
initializeSystemDefaults(swingProps);
initializeDefaultLAF(swingProps);
initializeAuxiliaryLAFs(swingProps);
initializeInstalledLAFs(swingProps);
} finally {
// Make sure to always re-enable the JIT.
java.lang.Compiler.enable();
}
}
TYA does not like programs that call java.lang.Compiler.disable() !!
You can work around this by uncommenting the #define IGNORE_DISABLE in
tya.c (which is
why 1.2 crashes but
1.1v4 did not)
regards
[ bryce ]
Re: Swing applications + TYA 1.2?
Bryce McKinlay <[EMAIL PROTECTED]> writes: > I was going to send this to Albrecht Kleine (author of TYA), but can't seem to > resolve his mail address, so I'll post it here. Origional message follows: > > -- [error message sniped] > Environment: - Kernel 2.1.131ac8 - glibc 2.0.7-29 - JDK 1.1.7v1a (tried with > both native & green threads) - Swing 1.1beta3 > > I have tried #undef EXCEPTIONS_BY_SIGNALS but the error still occurs. > > No problem with TYA 1.1-v4 ... > > --- > > Anyone have any ideas? > > [ bryce ] > > I see the same problem on a system with Kernel 2.0.35 and libc5. And it seems that Albrecht has a problem with his mail feed - my mail to him bounced, too. cheerio Jerry -- ||| ... and now for something completely different ... o o --m--!--m--
Re: Reading (All) Environment Variables in W95/NT
On Mon, 14 Dec 1998 [EMAIL PROTECTED] wrote:
The stuff you outline here depends on your shell: even on Unix it won't
work in all cases without some changes.
Solutions on NT:
1 Get bash and use that to run your java app. Then you can use your
backticks and other funnies. I think you can get it at www.cygnus.com. I
was looking at bash source code a while back and it looks intended to
compile for OS/2. Maybe the standard version will compile for NT with the
right compiler (probably gcc), maybe not. Look for gcc at cygnus too.
2 Use the set command:
set http://database/cgi-bin/
MyCharts.y=698
MyCharts.x=1216
watchlist=http://database/cgi-bin/list
[summer@possum etc]$
> I am getting some requests from NT users on an application that I wrote on
> a Java/Linux environment. I have a Java application that runs fine on Unix
> and I am trying to get to run perfectly on NT. I have a run time shell
> script that passes the entire environment to the JVM using a system
> property.
>
> java -Denv=`env` xenon.xsql.editor.Xsql
>
> The env produces the multiline environment variables list that we know and
> love. On running the application the program looks for the value of system
> property called `env'. Hence the JVM gets the entire environment. I have
> source code that breaks down the multiline value and cuts out each variable
> definition like `HOME=/home/peterp'. The definition is further split into a
> name and value (`HOME' and `/home/peterp') and then place stored in the
> system properties as renamed property `env.HOME' and `/home/peterp'. In
> short all the environment variable are prepended with `env.'. Using this
> hand-me-down old deprecated source code from an unknown URL, I can write
> code like this:
>
> String imagesDir=System.getProperty("env.IMAGES_DIR");
> String searchPath=System.getProperty("env.JAVAFILESEARCHPATH");
>
>
> Of course this does not work with Windows NT (or 95/98). I am not an expert
> on NT. I do not think there is an equivalent for `env' under NT.
> Is there such thing ?
>
> Of course I could write a work around that involve just passing a limited
> number of properties to JVM in a NT batch command `.BAT' file.
>
> java -DIMAGES_DIR=%IMAGES_DIR% ... xenon.sql.editor.Xsql
>
> Admittedly the full final code would look terrible ugly. I am clueless if
> the DOS? W95/NT Shell allows long character lines. Can you even do `back
> subtitution' using the W95/NT shell is also quite another thing as well?
> Also when I tried extending my `PATH' under W95 I got `out of environment
Read the docs on command.com - you need to expand the environment space.
Commandline lenght is acutely limited and you can't expand it.
> space' or something?
>
> However do any other java-linuxers know of a better solution or API?
>
> Any help receives my grateful kudos.
>
> Pete
>
--
Cheers
John Summerfield
http://os2.ami.com.au/os2/ for OS/2 support.
Configuration, networking, combined IBM ftpsites index.
native threads and jdk1.1.6
Hi, I'm currrently doing my masters thesis on concurrent paradigms in Java, and naturally I'm very interested in the fact that the linux port now has native thread support. Sadly, however, I've only got the jdk 1.1.6 source, and I'm finding it very difficult to get in touch with someone at sun so that I can get a copy of 1.1.7. Is it possible to patch the 1.1.6 jdk with the 1.1.7 patches (given that I don't mind messing around a bit), or have there been too many changes between 1.1.6 and 1.1.7? Alternatively, has there been any work done on retrofitting the native thread support to the 1.1.6 jdk? Thanks, Toby.
Re: Linux Red Hat ethernet driver
On Mon, 14 Dec 1998, Dan Finkelstein wrote: > Hi- > > Sorry if this is the wrong list, but... It is. > > I'm installing Red Hat Linux 5.2 on a Compaq. The ethernet driver, tlan.o, > for this machine is copied to the file system. But Red Hat's install > program doesn't list it amongst its drivers from which to select. I have > the file, but don't know how to "install" it manually. Its name is tlan.o > and is in the directory with all the other ethernet drivers. > > This is probably really easy, but I'm stumped, > Dan > -- Cheers John Summerfield http://os2.ami.com.au/os2/ for OS/2 support. Configuration, networking, combined IBM ftpsites index.
Re: Problems with Threads (Code included)
I Think this was stated before but anyway here goes again. The Cliente.class is derived from java.lang.Object and every object has a Monitor. The Monitor for an object "this" can only be accessed by a synchronized methed(s) of the object , which is this case is Cliente.class in recibirPeticion() and enviarPeticion(). By using "Thread.currentThread().wait()/notifyAll()" in this code, the monitor being asked for is the Monitor for the class "java.lang.Thread" not the Cliente.class. Simply remove "Thread.currentThread()." from the invocations of wait() and notifyAll() and the exception should go away. Cheers Chris Juergen Kreileder wrote: > > Mario Camou writes: > > Mario> Carlos, > Mario> Your problem is with > Mario> Thread.currentThread().wait()/notifyAll(). Since your > Mario> method is synchronized, you own the monitor for "this", not > > No. Since the the methods are 'synchronized' and 'static', he > owns the monitor for 'Cliente.class' > > Juergen > > -- > Juergen Kreileder, Universitaet Dortmund, Lehrstuhl Informatik V > Baroper Strasse 301, D-44221 Dortmund, Germany > Phone: ++49 231/755-5806, Fax: ++49 231/755-5802 begin:vcard n:Hinds;Christopher tel;fax:718-789-7906 tel;home:718-789-7906 x-mozilla-html:FALSE org:Heuristic Systems, Inc. version:2.1 email;internet:[EMAIL PROTECTED] title:Chief Engineer - President adr;quoted-printable:;;160 FIFTH AVE=0D=0ASUITE 4R;Park Slope;NY;11217;USA x-mozilla-cpt:;0 fn:Christopher Hinds end:vcard
Re: Problems with Threads (Code included)
On Mon, 14 Dec 1998, Carlos Alberto Roman Zamitiz wrote: > Hi, I attached my Cliente.java > I have 2 threads: Receptor and Transmisor. Receptor sends and receives > data from server, using method recibirPeticion(), forever (well, it sleeps > 3 seconds). When Transmisor sends data, using method enviarPeticion(), > Receptor must wait until Transmisor ends his transmition. > > I get > java.lang.IllegalMonitorStateException: current thread not owner You need to do just this.wait() and this.notifyAll(), notification happens on the object Receptor and not on the threads. . . . Sean.
Re: Problems with Threads (Code included)
The use of "this" is just plain redundant since Cliente.class is by default derived from "java.lang.Object" it is not nessassary to append "this." to wait() or notify() or any other of the monitor metheds in this case. Hint : take a look at the core API class hierarchy. Cheers Chris [EMAIL PROTECTED] wrote: On Mon, 14 Dec 1998, Carlos Alberto Roman Zamitiz wrote: > Hi, I attached my Cliente.java > I have 2 threads: Receptor and Transmisor. Receptor sends and receives > data from server, using method recibirPeticion(), forever (well, it sleeps > 3 seconds). When Transmisor sends data, using method enviarPeticion(), > Receptor must wait until Transmisor ends his transmition. > > I get > java.lang.IllegalMonitorStateException: current thread not owner You need to do just this.wait() and this.notifyAll(), notification happens on the object Receptor and not on the threads. . . . Sean. begin:vcard n:Hinds;Christopher tel;fax:718-789-7906 tel;home:718-789-7906 x-mozilla-html:FALSE org:Heuristic Systems, Inc. version:2.1 email;internet:[EMAIL PROTECTED] title:Chief Engineer - President adr;quoted-printable:;;160 FIFTH AVE=0D=0ASUITE 4R;Park Slope;NY;11217;USA x-mozilla-cpt:;0 fn:Christopher Hinds end:vcard
Re: Problems with Threads (Code included)
> Christopher Hinds writes:
Christopher> [1 ]
Christopher> [1.1 ]
Christopher> The use of "this" is just plain redundant since
Christopher> Cliente.class is by default derived from
Christopher> "java.lang.Object" it is not nessassary to append
Christopher> "this." to wait() or notify() or any other of the
Christopher> monitor metheds in this case. Hint : take a look at
Christopher> the core API class hierarchy.
The use of 'this' is neither redundant nor allowed here -- the
methods (recibirPeticion() and enviarPeticion()) are static and
there is no 'this' in class methods. A 'synchronized static' method
synchronizes on the class object.
// in this example sm1 & sm2 are equivalent and so are m1 & m2
class C
{
synchronized static void sm1() {}
static void sm2() { synchronized(C.class) {}}
static void m1() {}
void m2() { synchronized(this) {}}
}
You will get compile time errors both for wait() and this.wait() in
static methods. this.waits() fails because there is no this.
wait() fails unless your class has a static method named wait()
[Note: there is no such thing as inheritence for static methods in Java].
The orignal author has several possiblities to fix his code, one
would be to use an explicit lock object , e.g.:
class C
{
static Object lock = new Object();
static void m()
{
synchronized (lock) {
lock.wait();
}
}
static void n()
{
synchronized (lock) {
lock.notifyAll();
}
}
}
Juergen
--
Juergen Kreileder, Universitaet Dortmund, Lehrstuhl Informatik V
Baroper Strasse 301, D-44221 Dortmund, Germany
Phone: ++49 231/755-5806, Fax: ++49 231/755-5802
Re: Problems with Threads (Code included)
> The use of 'this' is neither redundant nor allowed here -- the > methods (recibirPeticion() and enviarPeticion()) are static and > there is no 'this' in class methods. A 'synchronized static' method > synchronizes on the class object. Jeurgen is of course right, sorry I didn't take enough time to look at the code properly. I believe it is possible to do a wait() on the class object also, but it is better practice to synchronized on an explicit lock object as Juergen's example provides. . . . Sean.
