Date: Wed, 29 Oct 2003 08:29:05 +0000 (GMT) From: Jan Grant <Jan.Grant@bristol.ac.uk> To: "M.D. DeWar" <mark@s-wit.net> Cc: freebsd-java <freebsd-java@FreeBSD.org> Subject: Re: Newbie attempting to install java on FreeBSD - what a adventure. Message-ID: <Pine.GSO.4.58.0310290809000.26696@mail.ilrt.bris.ac.uk> In-Reply-To: <001b01c39d68$796f9020$fb65a8c0@ocfl061> References: <001b01c39d68$796f9020$fb65a8c0@ocfl061>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 28 Oct 2003, M.D. DeWar wrote: > Hello, > I am trying to get java to install/run/ on a FreeBSD 4.8 box. > I ain't bitching or complaining. Maybe whinning. Okay am whinning. > Its a bitch to get this running. In reading I understand its mostly Sun's > refusal to be helpful. Or at least thats the impression I got in reading > pages/mail list postings on the net. That's not the problem you're having. > When I try to run babylon chatserver I get this: > > spiderman# ./java /temp/babylon-2.1_BETA/babylonServer > Exception in thread "main" java.lang.NoClassDefFoundError: > /temp/babylon-2/1_BET > A/babylonServer For complete information, you need to read the online docs for the "java" command. In a nutshell: - if the babylonServer comes with a wrapper shell script to run it, you probably just need to set JAVA_HOME and then execute the script (which should call java for you) - if /temp/babylon-2.1_BETA/babylonServer is a runnable .jar file, you can run this by calling: java -jar /temp/babylon-2.1_BETA/babylonServer.jar The error you're seeing is because invoking "java foo" will look for the class foo on your current classpath. If the babylonServer is actually just a pile of .class files in a directory tree, you need to ensure that the top-level directory of the tree is on your CLASSPATH. CLASSPATH confusion is the number one stumbling block when beginning to use java, in my experience. > More google searches brought me here: > http://www.eyesbeyond.com/freebsddom/java/jdk14.html > However I am not sure if I did the patches right. I don't think I did. The patches you mention are used to build a 1.4 JDK from source, using the ports tree. > In the build readme it says for experienced but hell out the hell is a > newbie to get experience with incomplete docs like this: Well, you might want to look at the FreeBSD handbook (online), particularly at the explanation of the ports system, which should help. You should also note that the native 1.4 JDK is still a "work in progress" and has yet to be packaged for simple installation (although if you fetch the source and patches manually the ports tree does a pretty good no-brainer install). As to the lines you're concerned about in those instructions, > unsetenv LANG > <<<<< ??????? > > unsetenv JAVA_HOME > <<<WTF is all this mean in NEWBIE ENGLISH ??????????????????? On FreeBSD, the default shell is traditionally csh (or tcsh), not bash, like you'll find on many Linux systems. csh-derived shells use "setenv" and "unsetenv" to manage environment variables. > In additional, with the recommended ports, one would use > > setenv ALT_BOOTDIR /usr/local/linux-sun-jdk1.4.1 > <?????????????????????????????? The ports system builds software from source. Java requires a working java installation to bootstrap itself; so to install a native (not Linux) JDK from source, you need the linux JDK installed the first time you compile it. > setenv ALT_BOOTDIR /usr/pkg/java/sun-1.4 < > ??????????????????????????????????? > > on NetBSD The port is not solely targetted at FreeBSD. NetBSD is another, similar, operating system. > I am so lost now I have no idea were to turn or what to do. ? Other than > drink heavily. It sounds from what you're saying that you've successfully installed both the Linux JDK _and_ the diablo JDK (although you may not realise it). Your problem seems to stem from a misunderstanding about invoking java from the command line: in a nutshell - - ensure JAVA_HOME is set to the top-level directory of your java installation (so that your Java can be detected successfully by shell scripts that use this convention) - ensure that your PATH contains ${JAVA_HOME}/bin (so that the "java" and related commands can be found) - you do not need to include rt.jar and so on in your CLASSPATH; this is taken care of automatically. > Again I am not trying to blame or bitch about this. Just show my confusion > and frustration in trying to install. As a newbie. > > If anyone can help me out I would greatly appreciate it. I hope this helps somewhat. If you can provide more information about what files are in your babylonServer directory that would be a help. Cheers, -- jan grant, ILRT, University of Bristol. http://www.ilrt.bris.ac.uk/ Tel +44(0)117 9287088 Fax +44 (0)117 9287112 http://ioctl.org/jan/ Strive to live every day as though it was last Wednesday.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.58.0310290809000.26696>