pavement

Talk:Java

From FreeBSDwiki
Revision as of 13:20, 12 January 2005 by Simon (Talk | contribs)
Jump to: navigation, search

Contents

This didn't help!!

I'm just trying to have simple java application run in mozilla or linux-mozilla (whichever works first) but the about plugins refuses to list java for some reason despite the symlink. I don't need the whole SDK.

I've installed linux-mozilla and the jre and everything else. Flash works fine by the way, I don't see which step Java requires that Flash didn't...

I've been at this for weeks, but now I've got internet to help me finally! Except another 2 days was fruitless.

If I get that last step to work I promise a full walkthru in the wiki. But for now, I'm 100% stumped.

For your info, I'm a bottom feeder rookie on FreeBSD (i.e. a traumatized Windoze regugee). Detailed explanations are welcome.

relax

to make a long story much shorter

You need a working java compiler to compile java on a freebsd system. so the work around is to install the linux jdk, add the files that building java requires (in /usr/ports/distfiles -- all those files that the webpage says to install) and then go into /usr/ports/java/jre (or jdk14 or whatever) and build it. It takes a) a long time and b) a lot of diskspace. I understand that if you install the linux browser (instead of compiling mozilla/firefox from ports or using freebsd pkg) you can also use the linux java jre with it.

Dave

...

Can you say that in terms of what the exact things to type are?

What is linux-mozilla and its difference from mozilla? Is that what I need?

In any case the "enable" step seems not to work at all. The plugin listing won't show java.

relax

also

see this link form the newbies mailing list: http://www.freebsd.org/cgi/getmsg.cgi?fetch=107129+112090+/usr/local/www/db/text/2004/freebsd-newbies/20041107.freebsd-newbies

you may fare better by installing one of the diablo binaries: http://www.freebsdfoundation.org/downloads/java.shtml


Diablo:

"These binaries are not intended for use with FreeBSD 5.x, due to a binary compatibility issue we are working with the FreeBSD release engineering team to resolve."

so I can't use that. I'll check the newbie thing. Thanks!

relax

in which case,

it would seem (from what i've read) that your only option is to either use the linux mozilla and linux java on your freebsd5 system, or install the linux jdk so that you can make a freebsd jdk so that you can THEN compile the JRE native for your system. (althogh once you've got the JDK, you can stop there, obviously -- you'd only need to build the jre if you wanted to delete the jdk afterwards.)

"Linux" ports

FYI, anything you see in the ports labeled "linux-[something]" is a "fake port" - it's not really something you'll compile locally, typically, it's a distributed binary which expects to be run under a Linux system, that will be run by your system under the Linux Binary Compatibility layer. (Which you'll want to make sure you have installed, if you need to run any linux binaries. Natch.)

--Jimbo 11:00, 28 Dec 2004 (PST)

yes,

this being the reason you need to install a linux java before you can make your freebsd native version; building the java jdk/jre requires...wait for it...a working java jdk. which you won't have. so you need to use the linux version under the linux emulation layer (which is why you have the "kldload procfs" lines in the quick & dirty howto on the Java page). After you've used it to make your java that runs native on freebsd (without linux emulation,) you can deinstall the linux-java and hell, even make a package from it on that system and copy it over vis NFS or scp or whatever to other systems. (as the author of the taosecurity site I linked to on the Java page did, incidentally.)

Dave

Linux base 7 won't do java

My Linux base 7 isn't compatible with java for mozilla if I get it correctly.

And what's that flashwrapper thing???

relax

did you install linux compatibility and load procfs ?

%cd /usr/ports/java/linux-sun-jdk14

%make install ===> linux-sun-jdk-1.4.2.05 You must manually fetch the J2SE SDK self-extracting file for the Linux platform (j2sdk-1_4_2_05-linux-i586.bin) from http://javashoplm.sun.com/ECom/docs/Welcome.jsp?StoreId=22&PartDetailId=j2sdk-1.4.2_05-oth-JPR&SiteId=JSC&TransactionId=noreg, place it in /usr/ports/distfiles and then run make again.

%more pkg-message ....====================================================================== Warning: This JDK may be unstable. You are advised to use the native FreeBSD JDK, in ports/java/jdk14.

This Java VM will attempt to obtain some system information by accessing files in linux's procfs. You must install the Linux emulation procfs filesystem for this to work correctly. The JVM will exhibit various problems otherwise. This can be accomplished by adding the following line to your /etc/fstab file:

linprocfs   /compat/linux/proc   linprocfs   rw   0  0

and then, as root, executing the commands:

kldload linprocfs mount /compat/linux/proc

.....====================================================================== %

---

I get this:

LoadPlugin: failed to initialize shared library
/usr/home/relax/j2re1.4.2_06/plugin/i386/ns610-gcc32/libjavaplugin_oji.so
[Shared object "libdl.so.2" not found]

What's the problem?

relax

not following you

what order did you do this in?

--install linux compat via sysinstall
--add the linprocfs line to /etc/fstab
--kldload etcetcetc
--install the linux java port?

= what relax did:

1. install linux compat via sysinstall (unsure of success) 2. add the linprocfs line to /etc/fstab 3. kldload etcetcetc (as per make install message I get when I compile) 4. install the linux java port 5. install the jdk14 6. follow the unclear, incomplete instruction that seem to want a ln between mozilla and the JRE:

cd <Mozilla>/plugins
ln -s <JRE>/plugin/i386/ns610-gcc32/libjavaplugin_oji.so .

And starting mozilla gets me the error message I mentionned.

How do I verify step 1 is done OK, knowing I don't get compile errors?

What am I expected to do in step 6, exactly? Link mozilla? Link linux-mozilla? In /usr/X11R6/include/mozilla/plugin or elsewhere? And once I've done that, do I start mozilla or linux-mozilla or linux-mozillafirebird or what? Exact commands are needed, the 6 walkthrus I've read are all unclear and inconsistent on what to do on step 6 and what browser can or can't run java.

And what is diablo-latte (which I messed up apparently, as it can't be pkg_add or pkg_delete or deinstall or install)? Does that interfer?

P.S.: I'm using the 1.4.2_02 version, in theory, as the 1.4.2_06 compile simply dumps core without explanation of any kind.

so wait

which mozilla are you using? the linux-mozilla port or the native BSD? the ln -s between the JRE and the mozilla will only work if both are either native or both are linux ports.

from your description, what you did is what you're supposed to. ln -s <Java plugin.so PATH> <mozilla directory>

although....if you installed the linux-moz and you had the freebsd moz installed already, you may have copied the file to the wrong direcotry....find out where the linux mozilla port installed to -- could be /usr/local/somethingsomething/something ...you might be able to find out with pkg_info.

also, the diablo JDK does not install with pkg_add -- I was wrong about that. you need to download that to /usr/ports/distfiles and then go into /usr/ports/java/diablo-jdk (or whatever the dir is,) and do a make install there. (DO NOT UNTAR/UNZIP the tgz btw). let me know how that works out for you.

--Dave 20:04, 11 Jan 2005 (EST)

as i stated before....

As I stated before, Diablo-jre-1.3.1.0 can't be pkg_add or pkg_delete or make install or make deinstall - in all cases I get errors saying it's installed - or not installed. The comment is listed as "???" in pkg_info. I'm not even sure diablo-jre is or isn't part of the install as jre-1.1.8 is installed to. Which JRE is the good one?

I've spend 34 hours already trying the possible permutations of that "ls -s <etc>" command and didn't find the right one - and I'm out of options (and yes I used rehash). Even if I had the right one how do I recognize it if there is still a bug or missing step somewhere??

What I really, really need is a clean walkthru as I've now got 7 incomplete and unclear ones who contradict each other and the combinaisons of possibilities have all been tried - there must be a small step missing or the diablo problem is preventing java from working.

If I reach my 10th install from scratch to see if I can't get it right this time and still fail (currently: 8th) I'll simply have to let go of a nice job offer involving java beta testing ... *shudder*

do not use pkg_add

don't use the package tools to install diablo.

how to install diablo-jre:

  1. download the diablo .tgz or .tbz
  2. mv it to /usr/ports/distfiles
  3. cd into /usr/ports/java/diablo-jre
  4. make install

--Dave 11:40, 12 Jan 2005 (EST)

---

As I stated before, Diablo-jre-1.3.1.0 can't make install or make deinstall.

To be more specific:

Result for make install: error message saying it's already installed.

Result for deinstall: Error message saying it's not installed.

I'm still clueless if Diablo is necessary or not to some or all install types, browser types, or if it's a linux-emulation thing, or whatever. What is Diablo? Do I really need it?

If it's not 100% mandatory, how do I install java without the badly-installed Diablo getting in the way of java working in the browser (if that's my problem)?

relax

see also

http://taosecurity.blogspot.com/2004_01_01_taosecurity_archive.html#107404060982021452

Thanks, I'll try that next!

relax

Personal tools