FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora Development Java

 
 
LinkBack Thread Tools
 
Old 07-01-2008, 06:30 PM
Benjamin Reed
 
Default libvirt-java bindings

David Walluck wrote:


These should be available through the jpackage macros from
jpackage-utils (see /etc/rpm/macros.jpackage).


Ah, ok.


| My main issue is that as a package maintainer, if I want to support
| Fedora officially *and* other RPM-based distributions (through our own

Not at all. If you follow the JPackage conventions you will support any
distribution which carries jpackage-utils. These include: ALT, Fedora,
Mandriva, PCLOS, Red Hat, Suse, and possibly others.


OK, I'll give the JPackage stuff another look.

My previous foray into jpackage was a mess of hand-building from
src.rpms and other craziness just to get around things that were already
provided easily from sun or otherwise, and I must admit, I was very
turned off by the amount of manual work it took to install something
when the whole point is to automate installation. =)


If the tools have gotten better, great, I'll give it another shot.


This also means, like I said in a previous email, that I don't think
additional macros are needed, but check the macros file first and see if
you think anything is missing.


Yeah, if everything conforms to the java/java-devel stuff, then it
should work.


Thanks for the response, I'll do more investigation.

--
Benjamin Reed
The OpenNMS Group
http://www.opennms.org/


--
fedora-devel-java-list mailing list
fedora-devel-java-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-java-list
 
Old 07-01-2008, 06:36 PM
David Walluck
 
Default libvirt-java bindings

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Benjamin Reed wrote:
| My previous foray into jpackage was a mess of hand-building from
| src.rpms and other craziness just to get around things that were already
| provided easily from sun or otherwise, and I must admit, I was very
| turned off by the amount of manual work it took to install something
| when the whole point is to automate installation. =)

If you are looking for a single monolithic package with no dependencies,
then it will not do that (but then generally neither will Fedora or any
other RPM-based distribution).

Otherwise, raise the specific concerns as you come across them and we
will see if it has to be that way or if there is some technical solution.

- --
Sincerely,

David Walluck
<david@zarb.org>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mandriva - http://enigmail.mozdev.org

iEYEARECAAYFAkhqeS4ACgkQItObMyg2XCXS2gCfc8PaiuCupR fRvSeIjz9uhsWR
SZoAn3kEJeY4+VPomR2KT1Df72I3S5B/
=0ETY
-----END PGP SIGNATURE-----

--
fedora-devel-java-list mailing list
fedora-devel-java-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-java-list
 
Old 07-01-2008, 07:40 PM
Farkas Levente
 
Default libvirt-java bindings

Daniel Veillard wrote:

Hi,

I have just started to release and package java bindings for libvirt.
I have made a request for review for Fedora on the new package:
https://bugzilla.redhat.com/show_bug.cgi?id=453119

I found the exercise rather hard, JNI is of course on the edge of the Java
land, but it's hard to find good resources to look at for Java bindings
in Fedora, the gnome-java stuff seems very specific, and a lot of packages
basically rely on gcj for compilation of any JNI stuff.


you may look into jna. gstreamer-java use it. it's much simpler, easier
then jni without the above problems.



--
Levente "Si vis pacem para bellum!"

--
fedora-devel-java-list mailing list
fedora-devel-java-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-java-list
 
Old 07-02-2008, 09:02 AM
Daniel Veillard
 
Default libvirt-java bindings

On Tue, Jul 01, 2008 at 05:36:56PM +0100, Mary Ellen Foster wrote:
> [ oops, just replied to Andrew the first time ... ]
>
> 2008/7/1 Andrew Haley <aph@redhat.com>:
> > Daniel Veillard wrote:
> >> the java class compilations break for example with java-1.5.0-gcj [-devel]
> >> on Fedora-8 (didn't tried icedtea yet, though I guess that would work)
> >> this looks related to dependancies when compiling a bunch of .java
> >> together in one command as
> >>
> >> /usr/bin/javac -classpath "org/libvirt" org/libvirt/*.java
> >> 2. ERROR in org/libvirt/VirConnectAuthDefault.java (at line 14)
> >> credType= new VirConnectCredential.VirConnectCredentialType[] {
> >> ^^^^^^^^
> >> credType cannot be resolved
> >>
> >> though VirConnectCredential.java is there and defines the type.
> >
> > Hmm. I think we need to find out if this is a real bug in ecj, and
> > fix it if so. I can't remember seeing anything like this before.
> >
> > Can you create a stand-alone test case that shows this failure? I can't
> > figure out how to do so.
>
> I think the problem might actually be a lack of "-source 1.5" on the
> javac line, actually. Without that, it doesn't seem to like the "enum"
> declarations and doesn't create any of the enum classes, resulting in
> the above error (and, if you scroll down, errors about the enum
> declarations too).

Haha, yes !
This fixes it. I still gets 3 warnings but not a blocker :-)

> This is testing with java-1.5.0-gcj-devel-1.5.0.0-17.fc8 on Fedora 8, FWIW.

Right :-)
If I understand correctly enum was added in Java 1.5, if I ask about
the version I get
laptop:~/libvirt-java/src -> /usr/bin/javac -version
Eclipse Java Compiler 0.771, 3.3.0, Copyright IBM Corp 2000, 2007. All rights reserved.

Maybe the most portable way to fix this is to force that version flag
when javac is the Eclipse compiler.

I think I will augment the checkings done in configure.in accordingly

thanks !

Daniel

--
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard | virtualization library http://libvirt.org/
veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

--
fedora-devel-java-list mailing list
fedora-devel-java-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-java-list
 
Old 07-02-2008, 09:14 AM
Daniel Veillard
 
Default libvirt-java bindings

On Tue, Jul 01, 2008 at 12:24:49PM -0400, David Walluck wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Daniel Veillard wrote:
> | I would like something more flexible, to that end I added some JDK dynamic
> | detection in configure.in for my package, which then allows to guess the
> | jni.h and jni_md.h based on the javah and javac used to generate the
> bindings
> | (so things should stay consistent).
> | In the spec file I used the following:
>
> There is no need since java and java-devel are virtual Provides provided
> by every compliant JDK, so the user is already allowed to choose the JDK
> that they want to build with.
>
> Also, there are macros that should be used when refering to the JDK so
> that you pick up the default JDK used for building and not the current
> default alternative (e.g., %{java_home}, %{java}, %{javac}, %{jar}).

Hum, interesting, butthat's very dependant on the build environment.
For example if I rebuild the RPM for RHELv4 those macro define won't exist
I don't think I should rely on this for a really generic spec file.

> Unfortunately, there are recent packages passing the Fedora review that
> directly specify java-1.6.0-openjdk-devel as the JDK and I personally
> don't like this.
>
> I think that this comes from two schools of thought: one group wants to
> tie the Fedora package even more tightly to Fedora and the other wants
> to leave the options open. Since Fedora more-or-less has only one JDK
> (or two counting GCJ which is optional), this benefit is mostly
> theoretical, but you can see from the current discussion that it can be
> useful. Similarly, since Fedora can force the default JDK setup at build
> time through the build system, although the packages are technically not
> as flexible as they could be, it's never really a problem in practice.

I think the distro build can already define its own policy of what
package should be used when there is a java/java-devel BuildRequires
just by the way it selects the package used to create the build root.
So %{java_home}, %{java}, %{javac}, %{jar} to me are in a sense redundant
in that enviroment.
And outside of the distro build the macros are not available and that's
where the user selection should be done, so this doesn't help much in the
case of a manual user rpmbuild, except maybe if one uses them to override
the alternative default.
I guess I need to think a bit more about it, but i'm firmly in the camp
of those who think the package should be distribution agnostic as much as
possible.

Daniel

--
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard | virtualization library http://libvirt.org/
veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

--
fedora-devel-java-list mailing list
fedora-devel-java-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-java-list
 
Old 07-02-2008, 09:20 AM
Daniel Veillard
 
Default libvirt-java bindings

On Tue, Jul 01, 2008 at 09:40:53PM +0200, Farkas Levente wrote:
> Daniel Veillard wrote:
> > Hi,
> >
> >I have just started to release and package java bindings for libvirt.
> >I have made a request for review for Fedora on the new package:
> > https://bugzilla.redhat.com/show_bug.cgi?id=453119
> >
> >I found the exercise rather hard, JNI is of course on the edge of the Java
> >land, but it's hard to find good resources to look at for Java bindings
> >in Fedora, the gnome-java stuff seems very specific, and a lot of packages
> >basically rely on gcj for compilation of any JNI stuff.
>
> you may look into jna. gstreamer-java use it. it's much simpler, easier
> then jni without the above problems.

Well back in 97 we tried to avoid JNI in the Kaffe project, the
alternative was more elegant, easier, faster. I think everybody outside
of java has hoped or tried to develop different bindings mechanism,
unfortunately none prevailed, at this point I will stick with JNI,

thanks :-)

Daniel

--
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard | virtualization library http://libvirt.org/
veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

--
fedora-devel-java-list mailing list
fedora-devel-java-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-java-list
 
Old 07-02-2008, 10:11 AM
"Mary Ellen Foster"
 
Default libvirt-java bindings

2008/7/1 David Walluck <david@zarb.org>:
> Mary Ellen Foster wrote:
> | I have one recent package that does this (specifies openjdk on F9+ and
> | icedtea on F8) and one that doesn't (just wants java >= 1.5). The
> | first package uses JNI and needs a Sun-like JVM to work (or at least
> | it took more autotools hacking than I cared to try to make it work),
> | and if I just put Requires: java it tended to grab gcj. I guess I
> | could also put java > 1.5, but the issue isn't the 1.5-ness, it's the
> | Sun-style JNI classes.
>
> This is not an issue with the java-devel packages, but rather an issue
> with either the upstream configure or an issue with the GCJ packaging.
>
> If it is lack of JNI support in GCJ, that is one thing. If it is simply
> that the package is expecting a differnt layout that is another.

I just did a bit of hacking, and it is possible to build the package
against gcj instead of openjdk. There were two things to fix:
- the "configure" script followed symlinks from javac to find the JNI
include dir. Since the symlinks for gcj ground out at /usr/bin/ecj, it
ended up looking for /usr/include/jni.h.
- It also wanted to hardcode "-ljava -lverify -ljvm" on the gcc line,
which isn't right for gcj

But I'm not sure if I want to make these modifications to the package.
If I build a JNI program against gcj, can the resulting .so be used
with Sun-like JVMs? How does this work? Is it documented anywhere?

Thanks,

MEF

--
Mary Ellen Foster -- http://homepages.inf.ed.ac.uk/mef/
Informatik 6: Robotics and Embedded Systems, Technische Universität München
and ICCS, School of Informatics, University of Edinburgh

--
fedora-devel-java-list mailing list
fedora-devel-java-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-java-list
 
Old 07-02-2008, 10:30 AM
Andrew Haley
 
Default libvirt-java bindings

Mary Ellen Foster wrote:
> 2008/7/1 David Walluck <david@zarb.org>:
>> Mary Ellen Foster wrote:
>> | I have one recent package that does this (specifies openjdk on F9+ and
>> | icedtea on F8) and one that doesn't (just wants java >= 1.5). The
>> | first package uses JNI and needs a Sun-like JVM to work (or at least
>> | it took more autotools hacking than I cared to try to make it work),
>> | and if I just put Requires: java it tended to grab gcj. I guess I
>> | could also put java > 1.5, but the issue isn't the 1.5-ness, it's the
>> | Sun-style JNI classes.
>>
>> This is not an issue with the java-devel packages, but rather an issue
>> with either the upstream configure or an issue with the GCJ packaging.
>>
>> If it is lack of JNI support in GCJ, that is one thing. If it is simply
>> that the package is expecting a differnt layout that is another.
>
> I just did a bit of hacking, and it is possible to build the package
> against gcj instead of openjdk. There were two things to fix:
> - the "configure" script followed symlinks from javac to find the JNI
> include dir. Since the symlinks for gcj ground out at /usr/bin/ecj, it
> ended up looking for /usr/include/jni.h.

Hmm. This package assumes that the chain of symlinks ends at the installed
binary, which must be in the jdk dir.

/usr/bin/javac -->
/etc/alternatives/javac -->
/usr/lib/jvm/java-1.4.2-gcj/bin/javac -->
/usr/bin/ecj

?

> - It also wanted to hardcode "-ljava -lverify -ljvm" on the gcc line,
> which isn't right for gcj

No. I'm surprised it's right for Java either; libjvm and libverify
I'd expect.

> But I'm not sure if I want to make these modifications to the package.
> If I build a JNI program against gcj, can the resulting .so be used
> with Sun-like JVMs? How does this work? Is it documented anywhere?

I think so.

Andrew.

--
fedora-devel-java-list mailing list
fedora-devel-java-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-java-list
 
Old 07-02-2008, 10:38 AM
"Mary Ellen Foster"
 
Default libvirt-java bindings

2008/7/2 Andrew Haley <aph@redhat.com>:
> Mary Ellen Foster wrote:
>> - the "configure" script followed symlinks from javac to find the JNI
>> include dir. Since the symlinks for gcj ground out at /usr/bin/ecj, it
>> ended up looking for /usr/include/jni.h.
>
> Hmm. This package assumes that the chain of symlinks ends at the installed
> binary, which must be in the jdk dir.
>
> /usr/bin/javac -->
> /etc/alternatives/javac -->
> /usr/lib/jvm/java-1.4.2-gcj/bin/javac -->
> /usr/bin/ecj
>
> ?

Yes. The comment in the configure script says "find the include
directory relative to the javac executable", and it loops through
links until it finds an actual binary. I hacked it for the moment by
adding
if [ `basename $_slink` = "ecj" ]; then break; fi
(where $_slink is the target of the current link) and it seems to work fine.

>> But I'm not sure if I want to make these modifications to the package.
>> If I build a JNI program against gcj, can the resulting .so be used
>> with Sun-like JVMs? How does this work? Is it documented anywhere?
>
> I think so.

Hmm. Maybe I'll give that a try this afternoon then.

Thanks,

MEF

--
Mary Ellen Foster -- http://homepages.inf.ed.ac.uk/mef/
Informatik 6: Robotics and Embedded Systems, Technische Universität München
and ICCS, School of Informatics, University of Edinburgh

--
fedora-devel-java-list mailing list
fedora-devel-java-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-java-list
 
Old 07-02-2008, 11:04 AM
Dalibor Topic
 
Default libvirt-java bindings

Daniel Veillard wrote:

On Tue, Jul 01, 2008 at 09:40:53PM +0200, Farkas Levente wrote:


Daniel Veillard wrote:


Hi,

I have just started to release and package java bindings for libvirt.
I have made a request for review for Fedora on the new package:
https://bugzilla.redhat.com/show_bug.cgi?id=453119

I found the exercise rather hard, JNI is of course on the edge of the Java
land, but it's hard to find good resources to look at for Java bindings
in Fedora, the gnome-java stuff seems very specific, and a lot of packages
basically rely on gcj for compilation of any JNI stuff.

you may look into jna. gstreamer-java use it. it's much simpler, easier
then jni without the above problems.



Well back in 97 we tried to avoid JNI in the Kaffe project, the
alternative was more elegant, easier, faster. I think everybody outside

of java has hoped or tried to develop different bindings mechanism,
unfortunately none prevailed, at this point I will stick with JNI,
I'll sing the praise for JNA, as it is VM-independent, so doesn't suffer
from the

problem most other (usually vm-specific) JNI-replacements do.

cheers,
dalibor topic


--
************************************************** *****************
Dalibor Topic Tel: (+49 40) 23 646 738
Java F/OSS Ambassador AIM: robiladonaim
Sun Microsystems GmbH Mobile: (+49 177) 2664 192
Nagelsweg 55 http://openjdk.java.net
D-20097 Hamburg mailtoalibor.Topic@sun.com
Sitz der Gesellschaft: Sonnenallee 1, D-85551 Kirchheim-Heimstetten
Amtsgericht München: HRB 161028
Geschäftsführer: Thomas Schröder, Wolfgang Engels, Dr. Roland Bömer
Vorsitzender des Aufsichtsrates: Martin Häring

--
fedora-devel-java-list mailing list
fedora-devel-java-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-java-list
 

Thread Tools




All times are GMT. The time now is 01:02 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org