# installing eclipse from ports. multiple JAVA dependencies



## vadimk (Dec 17, 2010)

Hi,

    While installing eclipse from ports I have noticed, that `# make install` pull out almost all JAVA JDK packages, i.e. : jdk16, diablo-caffe and openJDK6. Are all of them necessary later on? I am especially curious about openJDK installation, because it has some kind of internal bug that determined my ARCH as AMD64 while I have i386, so I got error:


```
sorry, unimplemented: 64-bit mode not compiled in
```

This error somehow comes from eclipse configuration, because if I make a fix in Makefile of openJDK6 (like here) and run `# make install` from eclipse port (and compile openJDK as dependency)  - it fails again, but from openJDK6 folder - it goes OK.

I would like to deinstall all unused JDKs, because I have noticed before that upgrading the eclipse port does not require in fact all of the JDKs. I had previously successfully upgraded eclipse, installed from packages with diablo-caffe JDK only.  
Does anyone have clear picture what eclipse should depend on? :\


----------



## SirDice (Dec 20, 2010)

Set your preferred java VM in /etc/make.conf like so:

```
JAVA_PREFERRED_PORTS?=JAVA_PORT_LINUX_SUN_JDK_1_6
```


----------



## graudeejs (Dec 20, 2010)

SirDice said:
			
		

> Set your preferred java VM in /etc/make.conf like so:
> 
> ```
> JAVA_PREFERRED_PORTS?=JAVA_PORT_LINUX_SUN_JDK_1_6
> ```



Where did you get that info?
What are other options?


----------



## SirDice (Dec 20, 2010)

killasmurf86 said:
			
		

> Where did you get that info?


Found it on a mailinglist, can't remember exactly where but it works. It also defines which java VM is started via java/javavmwrapper if you have several.


> What are other options?


Have a look in /usr/ports/Mk/bsd.java.mk.


----------



## rhurlin (Dec 23, 2010)

SirDice said:
			
		

> Set your preferred java VM in /etc/make.conf like so:
> 
> ```
> JAVA_PREFERRED_PORTS?=JAVA_PORT_LINUX_SUN_JDK_1_6
> ```



Hmmm, I am afraid this is not the solution. At least for me it does not work.

In java/eclipse/Makefile there is explicitly defined 
	
	



```
JAVA_VENDOR=openjdk
```
 So there must be a reason for it?


----------



## SirDice (Dec 23, 2010)

I don't use eclipse but it makes sense. To be able to build openjdk you must have a working java vm. I know it's odd but that's how it works. Try installing java/diablo-jdk16 then building openjdk. Once that's done you should be able to remove diablo.


----------



## rhurlin (Dec 23, 2010)

SirDice said:
			
		

> ..SNIP..
> Try installing java/diablo-jdk16 then building openjdk. Once that's done you should be able to remove diablo.



No, that is not my problem. I have a working, native jdk16 environment and want to hold it. I am not interested in openjdk at this time. 

In previous versions eclipse was able to build on jdk16. There must be a reason for changing this towards openjdk ...


----------



## graudeejs (Dec 23, 2010)

Edit port, comment JAVA_VENDOR and then see what happens


----------



## SirDice (Dec 23, 2010)

rhurlin said:
			
		

> In previous versions eclipse was able to build on jdk16. There must be a reason for changing this towards openjdk ...


It seems this got changed when the port was updated for eclipse 3.6.1:
http://www.freebsd.org/cgi/cvsweb.cgi/ports/java/eclipse/Makefile.diff?r1=1.72;r2=1.73;f=h

I suggest contacting the maintainer, I'm sure he knows the reason for it.


----------



## vadimk (Dec 24, 2010)

How can I contact the maintainer? I can only see author's login names in CVS.


----------



## SirDice (Dec 24, 2010)

```
root@molly:~#cd /usr/ports/java/eclipse
root@molly:/usr/ports/java/eclipse#make maintainer
freebsd-eclipse@FreeBSD.org
```


----------



## alc99vol (Jan 11, 2011)

Hello everyone,

I'm also having trouble with installing eclipse from port(sorry, unimplemented: 64-bit mode not compiled in..), BUT: when I have applied the patch that was mentioned above (here), the new problem appeared: freetypecheck can't locate freetype during openjdk 1.6 build, though, freetype is already installed: 
ERROR: FreeType version  2.3.0 or higher is required. 
Did anyone face this problem? Please, describe how to solve it.
vadimk, did you find out, is it possible to build eclipse with native jdk16?

Thanks in advance.


----------



## vadimk (Jan 12, 2011)

alc99vol said:
			
		

> Hello everyone,
> 
> I'm also having trouble with installing eclipse from port(sorry, unimplemented: 64-bit mode not compiled in..), BUT: when I have applied the patch that was mentioned above (here), the new problem appeared: freetypecheck can't locate freetype during openjdk 1.6 build, though, freetype is already installed:
> ERROR: FreeType version  2.3.0 or higher is required.
> ...



Hello alc99,

     Don't apply this patch directly. The latest Makefile is a bit different from one, mentioned in the patch. I have edited it manually changing only one variable:
  ARCH_DATA_MODEL=64 to ARCH_DATA_MODEL=32. After that eclipse compiled correctly. Don't forget to make clean of course.
     After eclipse was compiled and installed with openJDK, I haven't tried to modify JDK settings. So I have diablo, jdk16 and openJDK16 in the system - all of them.

Vadim


----------



## alc99vol (Jan 13, 2011)

Vadim: thanks a lot, it really worked.


----------

