Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Mar 1997 05:39:32 +0800 (WST)
From:      Adrian Chadd <adrian@obiwan.aceonline.com.au>
To:        Mats Lofkvist <mal@algonet.se>
Cc:        hackers@freefall.freebsd.org
Subject:   Re: java support under FreeBSD.
Message-ID:  <Pine.BSF.3.95q.970303052841.612B-100000@obiwan.aceonline.com.au>
In-Reply-To: <33197D76.41C67EA6@algonet.se>

next in thread | previous in thread | raw e-mail | index | archive | help
> A few more problems:
> 
> - I can't see any decent way to automagically execute <name>.class when
>   a user types <name>. If typing <name>.class is considered ok, why
>   is typing 'java <name>' not? If the solution is to add a soft link,
>   why not write a two-line script at once and avoid the need for kernel
>   support altogether?
>

ok.
the easiest bit is writing the code to detect the java binary "signature"
and it just hooks into the kernel the same way that other executables are
(see sys/kern/imgact_shell.c for a good example here).

I'm bout to write it to detect the ".class" at the end of the file and
remove it from the executable name, so the interpreter doesn't spew.
 
> - If the kernel only keeps track of a single CLASSPATH (via sysctl or
>   whatever), the user is limited to the code locations supported by
>   the sysadmin. Kind of not being able to set my own PATH, uck :-(
>   Maybe the kernel CLASSPATH should be appended to the users??
> 
>

You CAN set your path from what I have been playing around with. :)
Whenever a java image is going to be run, the support grabs its path, the
default classpath, and sticks them together and passes it to the java
interpreter. Nice, easy, and it works great from my testing.
 
> Seems like the shell script solution is the best one. Being able to
> set the CLASSPATH that make _this_ program work in the script is a
> additional benefit you can't get from kernel execution of the code.
> 
>
But its not transarent. *grin*

Thats the whole idea. Although since its tagged as an interpreted file,
you cant write a java shell interpreter to run a shell script from.
But thats not a problem right now, getting it to work right is. *grin*


       _
> Mats Lofkvist
> mal@algonet.se
> 

Since people are wondering bout how I'm doing it, I'll get it in a useable
state tonight and email it off to the list for people to poke at. Its
ugly, so don't blame me if you hate the code *grin*

Cya.

Adrian.





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95q.970303052841.612B-100000>