After researching my options with regards to video support in Java, I stumbled across Java Media Components mentioned a few times, along with this article that seems to hint they hoped to include it in Java 7.
This originally looked great, so I set about finding it in Java 7 with the hope of including video support pretty easily. Needless to say I couldn't find it, and after Googling around all I can really find are half baked references to crow-barring part of the thing out of JavaFX.
So does anyone know what happened to it? Was it dropped along with lots of other features for Java 7 and pushed back to Java 8? Or dropped entirely? Or is it now just been integrated into JavaFX? The latter would make most sense to me, but the latest JavaFX release just claims to support FLV (at least at the moment) whereas the references I can find to JMC seem to point to it supporting a whole host of formats.
Long question short, does anyone know what's going on?
Its still there, but pretty much ignored. Much of the UI aspects in Java have moved over to JavaFX, not sure how it might be with Video though.
In reference to your question, here's a link to the current page on Oracles site. I believe it was always a separate download and still is.
hth.
Related
Firstly, I think I may have titled this question poorly, but I couldn't think of the right words, so please, feel free to suggest an edit and I will make it, so that the question is more educational and relevant to others.
I know that javax.Swing simply cannot be used for an Android project, and I've accepted this and learned Android XML based UI design, but just out of curiosity, I want to know exactly why.
I realize that the screen dimensions of a phone might be something Swing wouldn't handle well, but what is to stop a developer from simply importing the javax.Swing package (besides Android Studio simply not letting it happen in the first place), however deformed and hideous Swing windows might be on an Android device screen? I also realize that AWT and SWT would also have to be imported, but the same question applies to these packages as well.
I think my lack of understanding of this might really root from a lack of understanding of how the Java Virtual Machine and the Android equivalent (is Dalvik still used, or have they switched cold-turkey to ART?).
As always, any information or reading on the subject you can provide is greatly appreciated. I really want to learn more about the fundamentals of how the JVM, Dalvik, and ART work.
There are at least three fundamental differences:
the APIs differ; for instance, even the most recent versions of Android's SDK don't have JSR 203;
the binary formats differ; Dalvik/ART does not generate JVM bytecode;
the language level differs; it is partly a consequence of the previous point, since in order to support a given language level, Dalvik/ART has to reimplement all the parsing/bytecode production to fit its own VM.
The latter point means that as a result, there is still no mainstream support in Android of try-with-resources which appeared in Java 5 years ago; various efforts have seen the day to support this plus Java 8's "goodies" over time, but none of them is really Java "at the core"; understand, they do not use the JVM, they do not use the Java compiler.
Recent news tells that this is bound to change in "Android N" (which will actually use OpenJDK). Which is good news. Also, as to point 1, you may recall that infamous Oracle vs Google case with regards to APIs being copyrightable... This is still not completely settled.
This article might be helpful to you http://www.techentice.com/dalvik-vs-art-android-drop-dalvik-efficient-art/ although, it is somewhat outdated, ALREADY. It does, however explain differences between JVM and DALVIK and ART.
I am looking forward to build a media player with java, and basically what I found was JMF. But, then again, this API is not upto date and doesn't support latest formats such as MKV. On more research, I stumbled upon
Any simple (and up to date) Java frameworks for embedding movies within a Swing Application?
Got all excited, but then digging some more, left me with this
Adding other video codecs / DVD support to JavaFX 2.2
Now, I am disappointed and in a fix that how all the good media players (VLC, KMPlayer etc) been able to support all video and audio formats. They must be build using a programming language, IMHO !
So, my question would be, in-order to build a complete media player which supports all kind of media files:
Is JAVA incompetent ?
Has one ever build a good media player using JAVA ?
Is it just Java or no modern language can do it ?
Do I have rely and choose C, C++ to do this ?
Well, Java is a programming language that was created to support multiple platforms (like Windows, Macintosh and Linux). It works with a virtual machine: a sandbox. So there are a few constrictions, that are based on this sandbox system: Everything, that you want to use in Java must be compatible with ALL platforms, java is created for. And because playing media is very near to the system and of course the hardware (soundcard, graphics board etc), Java may get problems on getting this compatible to all platforms. Another big problem is: Many codecs, you have to read and play (e.g. OGG-Vorbis) are not open sourced, so you will get problems on finding a good API to work with them. Of course there ARE APIs, but I have no experience with them.
Is JAVA incompetent ?
No, but Java was not created, to do system work. Of course, media playing is not a system work, but is near to the system. And Java does not implement codecs for playing music or videos, so you need custom APIs, as I said before.
Is it just Java or no modern language can do it ?
Well the problem is Java: Try a language, that supports more system- and hardware functionality.
Do I have rely and choose C, C++ to do this ?
In my opinion, this is your best opportunity. You may even use VB or VB.Net or whatever, but I think, you will get bigger problems with Java. Of course, this is just my experience, and other people may say you something different, but I think: Yes, C++ is a better language for a media player.
Hope, that answer helped you, greetings
Cydhra
P.S. Sorry, if my English is not that good, it is not my mother language...
The main problem with including more formats in Java by default is licensing restrictions - many of the popular formats are absolutely encumbered with patents and licenses, and for a company like Oracle to support lots of them as part of the JRE just isn't cost effective (in all likelihood.)
However, as mentioned before JFX8 is now open source, and you can thus compile in extra GStreamer plugins if you so choose. I did this recently with MKV, the process is described here if you want to do it with another format.
Since MKV is an open format, I also see no reason in theory why it can't be included in the default classes, so I created a ticket along with the patch - hopefully it may be included as standard in the not too distant future (absolute earliest 8u40.)
If you just want good media support in Java now however, and don't mind having VLC as a dependency, I'd use VLCJ - I use it in my application and it works a treat.
First of all, I have to precise that I am a 2d year bachelor student, so I'm still learning computer science and I'm not an expert. I have to implement a java program that can control VLC (tells it to play, stop etc.) while VLC is already running. My problem is that I can't figure out what APIs or java classes I should use in order to access VLC from my application. Since I didn't know where to start, I made quite a lot of researching and I bumped in some possibly interesting things:
firstly I thought Java Media Framework could help, but it seems that its purpose is to create kind of a fake graphical player with which you can stream multimedia files inside the java app, but that's not what I need
then I found out such VLCJ that seems to be what I need, but I still didn't get how it is exactly and how it works
So now my question is: is this VLCJ the right way? And in this case can someone please explain me how to use it or at least suggesting a point where to start? Should I use Runtime and Process classes to connect to VLC?
Otherwise, if I'm on the wrong way, are there any other solutions suitable for my problem?
PS: I also read something about a Remote Control Interface, but the explanations I've found are about some graphical content and not so clear, so I haven't gone deeper with that.
I've just started with Java and I have been using Netbeans. I have tried Eclipse but it kept crashing on me and I gave up. Since then I have produced a small application, but I find that I feel very restricted within the development environment, and I see lots of generated code that I really don't understand, and which seems to bear little resemblance to any code I may find while researching a problem.
With this in mind, and having seen many suggestions, I would rather begin to code by hand so that I understand exactly what is going where, and why.
My question(s):
I have seen and read through a great many tutorials but most of them assume a certain level of competency. I've built a small desktop editor in Netbeans, but I've never coded Java by hand. With that in mind could you suggest a good "getting starting" tutorial for me?
I would also like some advice on a coding environment. I will be creating desktop applications and am already familiar with Geany through coding in Python, but I've seen very little information about Geany and Java.
I'd appreciate any suggestions about this, because there seem to be a great many editors available, but please note that I am using Ubuntu on my development machine. Open source is not a requirement, but being free is.
BTW, I have no problems with trying Eclipse again if that seems to be the general consensus, I am currently just a little jaded on it since I have never successfully even tested anything without a cataclysmic crash.
Many thanks for any advice that you can give.
MVK
A Little Update
Many thanks to those of you who have taken the time to give an answer. I am currently playing about with the Sublime editor, suggested by user1432824, having had another try at Eclipse. Unfortunately though, Eclipse has a habit of crashing when saving files which is rather inconvenient. I plan to chase this up and see if there is a fixable reason, but it still feels a little heavyweight and integrated and I really want to move away from that if possible.
Thanks for the tutorial links, I've seen most of them already in my travels, but I'm happy to get more.
Finally
Many thanks for your input, I think that I have come to a comfortable result, with a few loose ends that Ill check on later. Here are my findings so far:
The Sublime Editor:
This was a tricky one. The Sublime editor is actually an excellent little app (despite how it looks out of the box!) and I have little doubt that I will use it at some point, but for now it lacks something for me, although I would be hard pressed to explain exactly what. Thanks for the suggestion though, its always good to find new editors.
Eclipse:
So I took the plunge and tried Eclipse again, and, just like the first time I used it I've been rather impressed with the overall look and feel of it, however, just like the last time it crashes at the most inopportune moments and despite much searching I have yet to discover the reason or the cure, which leaves Eclipse out of the running. Besides, although I like the feel of Eclipse it is still a bit on the heavyweight side for what I want to do.
BlueJ:
I admit that I did not try this program, although thanks for the suggestion. It seems to me like just another IDE and I really want to move away from the whole IDE thing for a while, at least until I understand a little more about how Java actually works.
Many thanks for your suggestions, but I think for now that I will go with Geany for a few reasons: As a very lightweight editor it can compile and run Java from the menu or keyboard, which just saves some time, and I have become addicted to the Snippets function which comes in handy once you have learned the basic syntax of whatever commands you add to it.
The only other choice now is between ANT and Maven and I think that the only way to decide between the two is to use both and see which one 'feels' better to me.
Many thanks to all who responded and my final question must be: Since you have all helped me reach my final decision, how to I go about accepting this question? Any advice on that front would also be helpful!
regards,
MVK
In my opinion, if you are new to Java, don't start with GUI. Start with simple text application. The best resource for beginners in my opinion is the official Java tutorial.
http://docs.oracle.com/javase/tutorial/
Good luck!
Have you looked at BlueJ ? From the website:
BlueJ is an integrated Java environment specifically designed for
introductory teaching.
BlueJ was developed at a University specifically for the purpose of
teaching object orientation with Java.
BlueJ is free!
I would strongly recommend using some form of IDE. It'll provide interactive debugging, hints, completion, code colourisation and useful error highlighting.
have you tried the Java online trainings?
http://java.sun.com/developer/onlineTraining/awt/contents.html
As for editors, I started out with a simple plain text editor like those that come on Mac and Windows. I also use Eclipse for Java Developers, and Sublime Text. Sublime has a free, unlimited trial, but will bug you every few saves to buy the premium version.
I would recommend that you get familiar with a build tool, like Ant or Maven. Once you have a project with more than 1 class in it, using a variety of libraries, it's good to have some help managing dependencies, running tests, building jars, etc.
My organization is considering PDFlib for dynamically creating PDF files (http://www.pdflib.com/) in our Java (Spring/Tomcat) environment.
Does anyone have experiences that they can share about the pro/cons of this Library?
We've been using PDFlib for a few years but we switched to DynaPDF recently (we are not using Java but C++). There never were any issues with the PDFlib - it always worked stable and reliable (and we really used all features including spot colors and importing of other PDFs).
It contains very good documentation and their support is fine, too.
Unfortunately, depending on what features of PDFlib you need, it is very expensive. We requested a 3-platform license without royalties (the PDI-enabled version), and were offered a licence for around 20,000 €. This is a bit expensive for a small company like ours.
So eventually we moved on to DynaPDF, which is less expensive and creates PDF files just as reliable. We got a license including source code for about €1000. I'm not sure if they provide Java wrappers, though.
Also this question might be interesting for you.
Hope that helps.
Iv been using pdfLib for about 3 years now and its been great for me. i guess it really depends on what you want to use it for but for me its been really good. I do a lot of file maniuplations and so far its been able to do everything i need very well. Support can be better but overall its not too bad but the software itself is great.