Re: Trying to compile a package that depends on bouncycastle
On Wednesday 16 Jul 2014 09:23:57 Emmanuel Bourg wrote: > > Bugs-nuts insane. Fricking Java, man. > > This has nothing to do with Java. Upstream should have provided a proper > build script, try asking them. With Maven, Ant, or Gradle you dot not > have to care about the dependencies and the javac syntax. Crap. Sorry, you're totally right. That rant doesn't belong on this list, and it certainly shouldn't have been directed at you lot. My frustration got the better of me, and I should know better by now. Still, the first time I need to use a Java project, it doesn't have a build system, and its only dependency is a library maintained by complete cowboys. How unlucky am I? But yeah, I can't justify even projecting that onto "the Java community" (whatever the hell that is), let alone debian-java. Apologies again, I'll go vent somewhere else now, and stop wasting everyone's time here. Regards, Adam -- To UNSUBSCRIBE, email to debian-java-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/201407161857.20999.a...@spra.gg
Re: Trying to compile a package that depends on bouncycastle
Le 16/07/2014 09:41, Adam Spragg a écrit : > ABI-incompatible changes without bumping the major version number? And people > *use* software from upstreams who work in this way? Unfortunately the BouncyCastle project is known for badly breaking the compatibility between releases, and this is an important component that can't be ignored. Hopefully that's the exception and not the rule (the other well know case being Guava). > Well, that makes me feel better about giving up and not looking any further > into this at all. I like my eyes in the non-bleeding state they are currently > in. > > Bugs-nuts insane. Fricking Java, man. This has nothing to do with Java. Upstream should have provided a proper build script, try asking them. With Maven, Ant, or Gradle you dot not have to care about the dependencies and the javac syntax. Emmanuel Bourg -- To UNSUBSCRIBE, email to debian-java-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/53c6369d.4060...@apache.org
Re: Trying to compile a package that depends on bouncycastle
On Wednesday 16 Jul 2014 08:28:33 gregor herrmann wrote: > On Tue, 15 Jul 2014 23:20:32 +0100, Adam Spragg wrote: > > Well, thanks for all the help, but now I'm stuck on step the 9th, trying > > to compile SignApk.java. And I think I'm just going to give up. > > > > I'm getting compile errors of the form: > > SignApk.java:20: error: cannot find symbol > > import org.bouncycastle.asn1.ASN1ObjectIdentifier; > > (No java expert here but ...) > > This BouncyCastle stuff has changed classnames and whatnot between > 1.46 and 1.47 or something: > > http://www.bouncycastle.org/wiki/display/JA1/Porting+from+earlier+BC+releas > es+to+1.47+and+later > > To me it looks like your program wants the new stuff, and you've > installed the older versions of bc. -- At least that's where I'd be > looking further :) ABI-incompatible changes without bumping the major version number? And people *use* software from upstreams who work in this way? Well, that makes me feel better about giving up and not looking any further into this at all. I like my eyes in the non-bleeding state they are currently in. Bugs-nuts insane. Fricking Java, man. Adam -- To UNSUBSCRIBE, email to debian-java-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/201407160841.32403.a...@spra.gg
Re: Trying to compile a package that depends on bouncycastle
On Tue, 15 Jul 2014 23:20:32 +0100, Adam Spragg wrote: > Well, thanks for all the help, but now I'm stuck on step the 9th, trying to > compile SignApk.java. And I think I'm just going to give up. > > I'm getting compile errors of the form: > > SignApk.java:20: error: cannot find symbol > import org.bouncycastle.asn1.ASN1ObjectIdentifier; (No java expert here but ...) This BouncyCastle stuff has changed classnames and whatnot between 1.46 and 1.47 or something: http://www.bouncycastle.org/wiki/display/JA1/Porting+from+earlier+BC+releases+to+1.47+and+later To me it looks like your program wants the new stuff, and you've installed the older versions of bc. -- At least that's where I'd be looking further :) Cheers, gregor -- .''`. Homepage: http://info.comodo.priv.at/ - OpenPGP key 0xBB3A68018649AA06 : :' : Debian GNU/Linux user, admin, and developer - http://www.debian.org/ `. `' Member of VIBE!AT & SPI, fellow of the Free Software Foundation Europe `- BOFH excuse #174: Backbone adjustment -- To UNSUBSCRIBE, email to debian-java-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/20140716072833.ge16...@colleen.colgarra.priv.at
Re: Trying to compile a package that depends on bouncycastle
Hi all, Well, thanks for all the help, but now I'm stuck on step the 9th, trying to compile SignApk.java. And I think I'm just going to give up. I'm getting compile errors of the form: SignApk.java:20: error: cannot find symbol import org.bouncycastle.asn1.ASN1ObjectIdentifier; Look, I've installed plenty of programs from source before. Dozens. Now, I don't expect every program ever to be quite as simple as "./configure; make; make install", but this is getting ridiculous. For pretty much every other program I've ever installed, I've never needed to know much about what language it was written in, or any of the internal details of that language environment. Provided I've got the right compiler and/or runtime installed, I've just downloaded the source, checked the README or INSTALL file or doc/ directory, and then done something like "./configure; make; make install". Maybe it was "cp makefile.unix makefile; make; make install". Oh, sure, sometimes programs have had dependencies. But installing a dependency is just "apt-get install libdependency-dev". Or, "wget ftp://dependency.com/latest/dependency.tgz; tar -xf depencency.tgz; cd dependency; ./configure; make; make install;" And once that's done, I can go straight to the program I actually want to use, and the configuration/build step will *automatically* find the dependency, and make me a program which will *automatically* use the dependency. That's it. I'm not trying to hack on these java programs. I'm don't want to study the code for its own sake, or track down a bug, or submit a patch upstream. I just want to *build* and *run* them. That's all. Nothing more, nothing less. Now, I've got these three repos. And none of them have README files. Anywhere. (OK, platform_system_core does, but it doesn't actually contain anything worth reading.) Or INSTALL files. Or doc/ directories. Or configure scripts. Or makefiles. They do have what look like makefile fragments, with comments, but no help as to how to actually use them - and all of the Java build processes I've briefly looked at seem to use either XML or JSON as their build description format. platform_build has an "envsetup.sh", but it's bonkers. First, it tells you to invoke it as "build/envsetup.sh", even though it's not in a directory called "build". Then, you don't *run* it, you *source* it into your shell and it does a whole bunch of violence to your environment, like creating function/alias called "m" to build the tree. Because you probably didn't have "m" aliased to anything you wanted to use yourself, did you? And that's just platform_build. The other repos don't have an equivalent, at all. So, after all of this, I'm left with 4 theories about what's going on here. 1) Google is ignoring all industry standard best practices for writing and packaging simple command-line apps in Java. 2) There are no industry standard best practices for writing simple command- line apps in Java, because Java is so uniquely unsuited to the task that practically no-one ever even tries.[0] 3) Google is actually following industry standard best practices for writing and packaging simple command-line apps in Java, and everyone in the Java industry thinks that the issues I'm seeing are a perfectly acceptable state of affairs, and not, you know, bug-nuts insane. 4) James Gosling read the spoof interview with Bjarne Stroustrup about how "[C++] was only supposed to be a joke, I never thought people would take the book seriously", thought it would be a good laugh to do for real, and is trolling me 20-odd years later. Of these, 1) seems unlikely on the face of it. That just doesn't seem like how Google would get things done. On the other hand, if 2) were the case, why in the softly-spoken name of the Elder Things would Google have picked Java to write them at all, rather than Python, Ruby, Perl, shell, C, Go, DOS batch files, or one the many thousands of other programming languages ever created which seem much better suited to the task, by virtue of not needing to be compiled, or, once compiled, can automatically locate both themselves and their dependencies and can just be, well, "run"? But then that only leaves 3) and 4), which are the most terrifying of all... Or, there is an option 5), which is that all of the above isn't actually that complicated, and I am actually really gorram stupid for not understanding it. I'm certainly *feeling* pretty stupid after a couple of days of banging my head against this particular brick wall, and it's not doing much for my perpetual case of imposter syndrome either. Whatever. You can keep your Java. I've had it. Adam [0] Re-specifiying dependencies on the command line every time you *run* a program? Really? As if anyone would do "ls --link acl,attr,pcre,selinux" every time they wanted to list the files in a directory. And have you *seen* the dependencies for something like a text editor? Try it - "ldd /usr/bi
Re: Trying to compile a package that depends on bouncycastle
Hey Adam, Like javascript, there are a few package managers for Java. Maven is one of the dominant ones. It acts like npm and grunt/gulp for javascript. It should handle setting up all the command line options for compiling, but if you are going to run something manually, you'll still need those magic options. It shouldn't be too difficult to find a tutorial on how to use Maven. For tiny projects, it's sometimes easier just to compile things manually in which case you should follow Emmanuel's comment. You'll want to use the same -cp arguments for both the javac and java commands. The -cp command just lists the dependencies which is usually needed if you use an import not under of the java.* namespace. Cheers, Andrew On Sun, Jul 13, 2014 at 2:07 PM, Adam Spragg wrote: > Hi Emmanuel, > > On Sunday 13 Jul 2014 19:10:30 Emmanuel Bourg wrote: >> Installing the package is not enough, you have to specify the libraries >> used when running javac. For example: >> >> javac -cp /usr/share/java/bcprov.jar:/usr/share/java/bcpkix.jar >> DumpPublicKey.java > > Ah, right. That did it! Thanks. > > Sorry, for some reason I thought that "import" in java worked as the > equivalent of a "#include " and a "-llibrary", and that dependencies > were findable in the filesystem by their import name, so it would all "just > work". > > Don't know where I got that from. > > Anyway, so that I don't have to ask the list next time, could someone point me > to a basic tutorial for this, so I can figure out for myself the mapping from, > e.g. "org.bouncycastle.jce.provider.BouncyCastleProvider" to > "/usr/share/java/bcprov.jar:/usr/share/java/bcpkix.jar" > > (Is there a java equivalent of pkg-config that will do it for me?) > > > Thanks again, > > Adam > > > -- > To UNSUBSCRIBE, email to debian-java-requ...@lists.debian.org > with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org > Archive: https://lists.debian.org/201407132207.38490.a...@spra.gg > -- To UNSUBSCRIBE, email to debian-java-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/CAGs-L4syw_XEJmuYFiMZF1grZa1D_1z2v6SOHrCkoh6G9P8z=g...@mail.gmail.com
Re: Trying to compile a package that depends on bouncycastle
Hi Emmanuel, On Sunday 13 Jul 2014 19:10:30 Emmanuel Bourg wrote: > Installing the package is not enough, you have to specify the libraries > used when running javac. For example: > > javac -cp /usr/share/java/bcprov.jar:/usr/share/java/bcpkix.jar > DumpPublicKey.java Ah, right. That did it! Thanks. Sorry, for some reason I thought that "import" in java worked as the equivalent of a "#include " and a "-llibrary", and that dependencies were findable in the filesystem by their import name, so it would all "just work". Don't know where I got that from. Anyway, so that I don't have to ask the list next time, could someone point me to a basic tutorial for this, so I can figure out for myself the mapping from, e.g. "org.bouncycastle.jce.provider.BouncyCastleProvider" to "/usr/share/java/bcprov.jar:/usr/share/java/bcpkix.jar" (Is there a java equivalent of pkg-config that will do it for me?) Thanks again, Adam -- To UNSUBSCRIBE, email to debian-java-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/201407132207.38490.a...@spra.gg
Re: Trying to compile a package that depends on bouncycastle
Hi Adam, Installing the package is not enough, you have to specify the libraries used when running javac. For example: javac -cp /usr/share/java/bcprov.jar:/usr/share/java/bcpkix.jar DumpPublicKey.java Emmanuel Bourg Le 13/07/2014 18:50, Adam Spragg a écrit : > Hi debian-java > > Following Matthew Garrett's recent post about self-signing Android ROMs[0], > I'm stuck on step the Sixth. > > I've got the DumpPublicKey.java file, and am trying to compile it. I > installed > openjdk-7-jdk, and then based on the next set of errors I received, > eventually > found the bouncycastle[1] binary packages and installed libbcprov-java, > libbcpg-java, libbcmail-java, and libbctsp-java. (This is on "stable") > > However, I still get the following error: > > adam$ javac DumpPublicKey.java > DumpPublicKey.java:19: error: package org.bouncycastle.jce.provider does not > exist > import org.bouncycastle.jce.provider.BouncyCastleProvider; > ^ > DumpPublicKey.java:236: error: cannot find symbol > Security.addProvider(new BouncyCastleProvider()); > ^ > symbol: class BouncyCastleProvider > location: class DumpPublicKey > 2 errors > > Now I'm a bit stuck. What else do I need to do to get > org.bouncycastle.jce.provider.BouncyCastleProvider to be found/recognised? > > Note, I'm a competent C, C++ and Javascript developer, but have no background > in Java development/tools/culture. So, while I'm generally technical, I'm > basically lost here. > > I had a look at the Debian Java wiki front page[2] and the Debian Java FAQ[3] > contents, but nothing appeared very relevant to my actual problem. (Apart > from > FAQ 1.5, which is why I'm mailing this list, rather than debian-java- > maintainers who own the bouncycastle package.) However, if there's some other > FAQ or tutorial which will help, then simply pointing me in that direction > should be more than sufficient. > > > Regards, > > Adam > > [0] http://mjg59.dreamwidth.org/31765.html > [1] "bouncycastle"? Seriously? > [2] https://wiki.debian.org/Java > [3] http://www.debian.org/doc/manuals/debian-java-faq/ > > -- To UNSUBSCRIBE, email to debian-java-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/53c2cb96.1020...@apache.org
Trying to compile a package that depends on bouncycastle
Hi debian-java Following Matthew Garrett's recent post about self-signing Android ROMs[0], I'm stuck on step the Sixth. I've got the DumpPublicKey.java file, and am trying to compile it. I installed openjdk-7-jdk, and then based on the next set of errors I received, eventually found the bouncycastle[1] binary packages and installed libbcprov-java, libbcpg-java, libbcmail-java, and libbctsp-java. (This is on "stable") However, I still get the following error: adam$ javac DumpPublicKey.java DumpPublicKey.java:19: error: package org.bouncycastle.jce.provider does not exist import org.bouncycastle.jce.provider.BouncyCastleProvider; ^ DumpPublicKey.java:236: error: cannot find symbol Security.addProvider(new BouncyCastleProvider()); ^ symbol: class BouncyCastleProvider location: class DumpPublicKey 2 errors Now I'm a bit stuck. What else do I need to do to get org.bouncycastle.jce.provider.BouncyCastleProvider to be found/recognised? Note, I'm a competent C, C++ and Javascript developer, but have no background in Java development/tools/culture. So, while I'm generally technical, I'm basically lost here. I had a look at the Debian Java wiki front page[2] and the Debian Java FAQ[3] contents, but nothing appeared very relevant to my actual problem. (Apart from FAQ 1.5, which is why I'm mailing this list, rather than debian-java- maintainers who own the bouncycastle package.) However, if there's some other FAQ or tutorial which will help, then simply pointing me in that direction should be more than sufficient. Regards, Adam [0] http://mjg59.dreamwidth.org/31765.html [1] "bouncycastle"? Seriously? [2] https://wiki.debian.org/Java [3] http://www.debian.org/doc/manuals/debian-java-faq/ -- To UNSUBSCRIBE, email to debian-java-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/201407131750.58376.a...@spra.gg