|
As of November, 2010, the Ptolemy project is using a slightly customize version of Jacl
as part of the Ptolemy test suite. For details, see
http://ptolemy.berkeley.edu/ptolemyII/ptIIlatest/ptII/doc/install_index.htm
java.lang.System.out.println
and Tcl Blend
tclBlend1.1/doc/html/contents.htm
tcljava-request@tclconsortium.org
with the subject
subscribe
To send messages to the list, send mail to
tcljava@tclconsortium.org
Note that the tcljava list is not run by majordomo, so the usual majordomo commands will not work
There are two archives: Tcljava Mailing List Archives: www.egroups.com - www.mail-archive.com
http://java.sun.com/products/jdk/1.1/download-jdk-windows.html
Note that Tcl Blend 1.1 will only work with the Sun JDK,
it will not work with the Microsoft JDK.
Tcl Blend 1.1 will work with either JDK1.1.6 or later, including JDK1.2fcs.
C:
top level directory,
so that C:\jdk1.1.7
is created.
C:\Program Files\Tcl
C:\Program Files\Tcl\TclBlend1.1
.
The installer will automatically install the .jar
files and the
.dll
files into
C:\Program Files\Tcl\lib\tclblend1.1
.
Start
menu, choose
the Tcl
menu, then choose the Wish
icon.
package require javaThen type:
java::call System getProperty "java.version"You should get back the version of the JDK that Tcl Blend is using.
package require java
line to your wishrc.tcl
or tclshrc.tcl
file so that java
Tcl package
is loaded each time you start up wish
or
tclsh
.
Under Windows, when Tcl sees a tilde (~), it uses the value of the
HOME
environment variable to find the user's home
directory. If HOME
is not set, then
HOMEDRIVE
and HOMEPATH
are used.
HOMEDRIVE
refers to the drive your home directory is on,
HOMEPATH
is the pathname to your home directory on
that drive.
HOMEDRIVE
and HOMEPATH
are set when
your account is created.
If neither HOMEDRIVE
or HOMEPATH
is used, then
c:\
is used.
www.javasoft.com
.
Note that Tcl Blend 1.1 will only work with the Sun JDK1.1.6 and later, including JDK1.2fcs.
bin
directory to your
path in your .cshrc
. If you install the JDK in
/opt/jdk1.1.6
, then you would add /opt/jdk1.1.6/bin
to your path.
http://www.scriptics.com/software/8.0.html
and install it.
bin
directory where you installed Tcl to
your path.
/opt
or /usr/local
is a good place to run untar Tcl Blend.
tclBlend1.0/unix/README
.
tclBlend1.0/unix
directory to your LD_LIBRARY_PATH
lib/sparc/native_threads
directory
to your LD_LIBRARY_PATH
/opt
,
you would add the following to your .cshrc
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/opt/tclBlend1.0/unix setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/opt/jdk1.1.6/lib/sparc/native_threads
LD_LIBRARY_PATH
variable and update your path
by sourcing your .cshrc
, then start up tclsh8.0
.
auto_path
Tcl variable. Assuming
you've installed Tcl Blend in /opt
, you would type
the following in to the Tcl prompt:
lappend auto_path /opt/tclBlend1.0
package require java
java::call System getProperty "java.version"you should get back the version of the JDK you are running.
cxh@carson 58% set path = (/usr/sww/tcl-8.0p2/bin /usr/ucb /usr/bin) cxh@carson 59% setenv LD_LIBRARY_PATH /opt/jdk1.1.6/lib/sparc/native_threads:/opt/tclBlend1.0/unix cxh@carson 60% tclsh % lappend auto_path /opt/tclBlend1.0 /usr/sww/tcl-8.0p2/lib/tcl8.0 /usr/sww/tcl-8.0p2/lib /opt/tclBlend1.0 % package require java 1.0 % java::call System getProperty "java.version" 1.1.6 %
lappend auto_path /opt/tclBlend1.0 package require javalines to
~/.tclshrc
and/or ~/.wishrc
so
that Tcl Blend is loaded each time you start tclsh
or wish
. If you add these lines, you may also
want to add a puts
to remind you that the Tcl Blend
package is being loaded.
JDK1.1 and Java Native Invocation (JNI) are both required to build Tcl Blend.
Note that under Solaris, Tcl Blend requires the native threads pack.
I believe that this was necessary to work around a bug
http://java.sun.com/nav/read/Tutorial/native1.1/implementing/invo.html
says
Limitations of the Invocation API in JDK1.1In a post to comp.lang.tcl, Scott Stanton wrote:As mentioned above, there are a number of limitations of the Invocation API implementation in JDK1.1.
The user-level Java thread implementation on Solaris requires the Java VM to redirect certain Solaris system calls. The set of redirected system calls currently includes read, readv, write, writev, getmsg, putmsg, poll, open, close, pipe, fcntl, dup, create, accept, recv, send, and so on. This may cause undesirable effects on a hosting native application that also depends on these system calls.
TclBlend is not dynamically loadable into tclsh using green threads. You have to build a special version of tclsh that initializes the Java VM before Tcl does any I/O operations. I would recommend that you apply the Solaris patches and use the native threads version if you can.
http://www.hp.com/esy/technology/jdk/products/os11pr112.html
said:
This release for HP-UX 11.00 includes the addition of a second virtual machine which permits you to use kernel threads to implement Java threads thus allowing a single Java application to make use of additional processors in a multiprocessor machine. This new virtual machine is the default virtual machine. The other virtual machine does not make use of kernel-threads to implement Java threads--it uses a portable, user-level "green threads" package. You have the option of using either virtual machine, and may want to try both to see which provides the best performance for your application. For more information, see (http://www.hp.com/esy/technology/jdk/products/document.html) Kernel Threads for HP-UX 11.00.It looks like the 1.1.6 port for HP-UX 10.20 does not support "Kernel" or native threads,
/opt/java/PA_RISC/native_threads
does
not exist, but /opt/java/PA_RISC/green_threads
does.
http://www.blackdown.org/java-linux.html
apparently supports Native Threads, though we have not tried it.
http://www.blackdown.org/java-linux/rel/117/v1a/README-1.1.7v1a.html
(Dead Link, try Archive.org)
says:
Native Threads support ---------------------- Starting with the 1.1.7 v1a port of the Java Virtual Machine, we have added native thread support. Traditionally, the JVM used user based threads, also known as "green" threads. Native threads, on the other hand, use the operating system to do the task switching. Native threads are thus a benefit in multi-processor (SMP) systems and they tend to make native method invocation support easier to deal with. Native threads do have some limitations relative to green threads. They require more overhead and are limited to the number of processes your Linux kernel supports. Native thread support is new as of 1.1.7 v1a due to the wonderful effort of Phill Edwards. To install the native threads package, you need to first download the JDK, JRE, RT and install that. Next, you need to get the matching native threads package and install that into the same location. Finally, to use the native threads version of the JVM, you need to set the THREADS_FLAG environment variable to "native" Note, that while the native threads support works very well and has been tested by the Java-Linux porting team, it should still be viewed as "beta" code as it has not had the extended testing that the green threads code has. Also, at this time there is no native threads support for libc5 systems. Only glibc based Linux systems.
Tcl Blend 1.1b1 can compile under Digital Unix V4.0B with JDK1.1.4. However, starting up is tricky, since it requires that we set the CLASSPATH and load libjava.so first:
cxh@bips 358% setenv CLASSPATH /usr/lib/classes.zip cxh@bips 359% tclsh8.0 % load /usr/shlib/libjava.so couldn't find procedure Java_Init % package require java 1.1 %If I don't have my CLASSPATH set, I get:
cxh@bips 367% unsetenv CLASSPATH cxh@bips 368% tclsh8.0 % load /usr/shlib/libjava.so couldn't find procedure Java_Init % package require java libjava.so: couldn't find procedure Java_Init Unable to initialize threads: cannot find class java/lang/Thread SIGILL 4* illegal instruction si_signo [4]: SIGILL 4* illegal instruction si_errno [0]: Error 0 occurred. si_code [1]: ILL_ILLOPN [addr: 0x0] Full thread dump: Abort process cxh@bips 369%If I don't do the first load, I get:
cxh@bips 376% setenv CLASSPATH /usr/lib/classes.zip cxh@bips 377% tclsh8.0 % package require java Loading 'libtclblend.so' failed: couldn't load file "libtclblend.so": dlopen: Unresolved symbols %I poked around and if I build libtclblend.so with:
ld javaCmd.o javaIdle.o javaInterp.o javaObj.o javaList.o javaNotifier.o javaTimer.o javaUtil.o tclResult.o unixNotifier.o -o libtclblend.so -shared -ljava -L/users/cxh/tcltk/lib -ltcl8.0 -lcThen I don't have to do the first load
To run the test suite, I had to edit pkgIndex.tcl
and add
if [catch {load /usr/shlib/libjava.so} errMsg ] { puts "libjava.so: $errMsg" }Most of the test suite passes, though the log shows that there are some failures.
www.javasoft.com
.
Jacl does not require the Sun JDK, but Tcl Blend does, so if you plan
on experimenting with Tcl Blend, you will need the Sun JDK.
c:\jdk1.1.6
, then add
c:\jdk1.1.6\bin
is in your path.
jacl.bat
script has a problem with
path names that have spaces in them, so do not install Jacl in C:\Program Files\Jacl1.0
.
README
file.
set CLASSPATH=%CLASSPATH%;C:\jacl1.0\jacl.jar java tcl.lang.Shell
Microsoft(R) Windows NT(TM) (C) Copyright 1985-1996 Microsoft Corp. c:\users\cxh>set CLASSPATH c:\jacl1.0\jacl.jar Environment variable CLASSPATH not defined c:\users\cxh>set CLASSPATH=c:\jacl1.0\jacl.jar c:\users\cxh>java tcl.lang.Shell % java::call System getProperty "java.version" 1.1.6 %
package require java
fails with
can't find package java
auto_path
is set, for example:
lappend auto_path /opt/tclBlend1.0
.
An alternative is to install Tcl Blend in the Tcl library directory.
www.javasoft.com
.
Jacll does not require the Sun JDK, but Tcl Blend does, so if you plan
on experimenting with Tcl Blend, you will need the Sun JDK.
/opt/jdk1.1.6
, then add
/opt/bin
is in your path.
INSTALL.txt
file.
CLASSPATH
and go.
cxh@carson 1% setenv CLASSPATH /opt/jacl1.0/jacl.jar cxh@carson 2% java tcl.lang.Shell % java::call System getProperty "java.version" 1.1.6 %Note that if you set your
CLASSPATH
in your
.cshrc
, then you may have mysterious problems with
Netscape and other applications. One way to avoid this is to
set up an alias in your .cshrc
:
alias jacl java -classpath /opt/jacl1.0/jacl.jar:/opt/jdk1.1.6/lib/classes.zip tcl.lang.ShellThen you can type
jacl
to start up Jacl.
cxh@carson 71% /opt/jdk1.1.6/bin/java tcl.lang.Shell Can't find class tcl.lang.ShellThen be sure that your
CLASSPATH
is set properly.
Last updated: %G%
cxh at eecs