# Problem with a linux program using java (on FreeBSD)



## cell (Jul 23, 2009)

Hi.
I have a problem installing a linux program on FreeBSD 7.2. I installed linux compatibility tool  when I installed FreeBSD. The linux program that i want to install need jre (the program script  run some .jar). I installed jre (diablo-jre-freebsd7.i386.1.6.0.07.02.tbz) from http://www.freebsdfoundation.org/downloads/java.shtml, but it is jre for FreeBSD. I think I have to install jre for linux, because the linux program that i want to install doesn't work again. I tried to install linux-sun-jre16 and linux-sun-jre15 from ports, but without success.
For example, when i try to install linux-sun-jre16 ports i have this error (not copy/pasted, but handwritten, therefore there could be some error in copying):



```
# make install clean
======================================================================
Warning: This JRE may be unstable. You are advised to use the native FreeBSD 1.6 JDK, in ports/java/jdk16

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 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

======================================================================
===> Extracting for linux-sun-jre-1.6.0.03
=> MD5 Checksum mismatch for jre-6u3-linux-i586.bin.
=> SHA256 Checksum mismatch for jre-6u3-linux-i586.bin.
===> Refetch for 1 more times files: jre-6u3-linux-i586.bin jre-6u3-linux-i586.bin
======================================================================
Warning: This JRE may be unstable. You are advised to use the native FreeBSD 1.6 JDK, in ports/java/jdk16

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 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

======================================================================
=> jre-6u3-linux-i586.bin doesn't seem to exist in /usr/ports/distfiles/.
=> Attempting to fetch from [url]ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/[/url].
fetch: [url]ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/jre-6u3-linux-i586.bin:[/url] File unavaliable (e.g., file not found, no access)
=> Couldn't fetch it - please try to retrieve this
=> port manually into /usr/ports/distfiles and try again.
*** Error code 1

Stop in /usr/ports/java/linux-sun-jre16
*** Error code 1

Stop in /usr/ports/java/linux-sun-jre16
```



I read this error message although i did everything you can read in this message. 
Can somebody help me?



P.S. Sorry for my English, if it's not perfect.  :beergrin


----------



## SirDice (Jul 23, 2009)

You can try going to Sun's java site and download that jre-6u3-linux-i586.bin file there. 
Once downloaded copy it to /usr/ports/distfiles and start the install again.


----------



## cell (Jul 23, 2009)

As i have written, i did so. But the error message appears although i have put this file in the /usr/Ports/distfiles folder.


----------



## SirDice (Jul 23, 2009)

Are you sure? This line tells me it isn't:

```
=> jre-6u3-linux-i586.bin doesn't seem to exist in /usr/ports/distfiles/.
```


----------



## cell (Jul 23, 2009)

I'm sure... for this reason this error seems really strange. If I install linux-sun-jre15 port the error is the same, but it ask me another version of that file. I obtained it and i put it in the /usr/ports/distfiles folder, but without success. 
Moreover, in both the cases, if I remember well, when the file wasn't put in that folder yet the error message was similar, but not identical to the message that I reported.

I don't know what can I do.


----------



## DutchDaemon (Jul 23, 2009)

SirDice said:
			
		

> Are you sure? This line tells me it isn't:
> 
> ```
> => jre-6u3-linux-i586.bin doesn't seem to exist in /usr/ports/distfiles/.
> ```



Well, almost:


```
=> MD5 [B]Checksum mismatch[/B] for jre-6u3-linux-i586.bin.
=> SHA256 [B]Checksum mismatch[/B] for jre-6u3-linux-i586.bin.
```

Cell, is your ports tree up-to-date?


----------



## cell (Jul 23, 2009)

Now I have run the following commands:

```
pkgdb -a
portupgrade -R linux-sun-jre16
```

But the error that I obtain when i run "make install clean" is the same.
Did I make a mistake in updating?


----------



## SirDice (Jul 23, 2009)

cell said:
			
		

> Did I make a mistake in updating?


Yes, those command do not update your ports tree.

Use either portsnap(8) or csup(1) to update your tree.


----------



## cell (Jul 23, 2009)

Now I have updated my ports tree using portsnap. I have run the following commands:

```
portsnap fetch
portsnap extract
```

But the result is the same. 

Maybe (I think, but I don't know) the jre file in /usr/ports/distfiles is damaged. Is it possibile?


----------



## aragon (Jul 23, 2009)

You really shouldn't need the linux JRE.  What happens when you try launch your java app with the diablo JRE?


----------



## cell (Jul 25, 2009)

aragon said:
			
		

> You really shouldn't need the linux JRE.



You're right. I don't know why, but now my program correctly works, without linux jre, but only using FreeBSD jre.
Thank you anyway!


----------

