I'm interested in writing games in Java and wondered if Minecraft is written purely using the standard JDK or whether it uses open source (or commercial for that matter) libraries.
Yes. Minecraft uses the LWJGL library for graphics and sound.
It uses Java Game Controller API jinput as well from here
Related
Java Desktop application: SWT vs. Swing
"requires native libraries for each supported system"
Does it mean that i have to rebuild my project for each OS, switching each time the libraries to the corresponding target's native library?
Or is there a way to actually put every libraries required by different OS in the same project?
I just started Java, as my second language, sorry if this question look stupid.
No, you don't need to rebuild your project. You just need to make sure you bundle the correct SWT native library for each platform (.dll, .so etc.) with your program -- SWT has built-in logic to determine the platform and load the correct library.
I'm using JMF in my Java GUI and before downloading the packages from Oracle, it asks you which version you want:
Linux
Solaris SPARC
Windows
Does this mean my Java (cross-platform by nature) application WON'T be cross platform any more?
There is a 100% pure Java implementation, but that does not support all codecs and doesn't run as efficiently as the version using native code. So, effectively, the JMF is not fully cross-platform.
The developers justify this by considering the JMF an extension to the Java platform itself rather than just a library: just like you have to download a specific JVM for your platform, but can reuse your source and object code unchanged, you need a platform-dependent JMF implementation, but the JMF clients can be reused unchanged.
JMF isn't a pure Java API, so it'll only work where it's officially ported.
I'm thinking about writing a development tool that will support development for Android.
I realize that people running Windows, Mac OS, and Linux all develop for Android, but what are the statistics?
Personally I run Windows, and I'd prefer to write it in C# with WPF, but WPF isn't exactly cross platform. I'm really only doing Java to target Android.
If it's cross platform, does Java make the most sense, or can it be .NET+GTK# or something like that?
EDIT: I have no intention of replacing the code editor/compiler/etc. It was more along the line of a graphics editor. Something that I don't think is supplied by any current tools.
The native Android SDK is Java based. Regardless of Operating System, many developers use the SDK Tools provided by Google, specifically the Android Plugin for the Eclipse IDE
I would try to get involved in either the IntelliJ Android tools or Eclipse Android tools development as those are already cross-platform and most-widely used.
Reinventing the wheel is not the best idea but improving an existent one is.
My opinion, best to stick with what everyone else uses. That's Eclipse + the ADT (android dev tools) plugins. As a developer, you want to spend your time writing your apps not struggling with tools.
As for the OS, I've used Windows, Mac, and Linux and with a few very minor exceptions they work equally well.
I agree with willytate, with this being great for android exchange.
If it's cross platform, does Java make the most sense, or can it be .NET+GTK# or something like that?
Java does make the most sense.
I am looking to create swf from Java, like ming from C/C++.
Is there anything like this for Java?
JavaFX was actualy created for these purposes.
TransformSWF from Flagstone Software is a SWF-generating library for Java.
It supports through Flash 7, is under reasonably active development, and has pretty good docs on its home page. BSD licensed.
Its sister TranslateSWF is meant for compiling AS1 into SWF-embeddable bytecode from Java.
maybe OpenLaszlo? not from java, but using java at least
JavaSWF - Macromedia Flash File Format
JavaSWF provides a pure Java wrapper for the Macromedia Flash file format (known as SWF). It enables the parsing and generation of Flash content within Java applications and servlets.
You could always use SWIG to generate a JNI wrapper for Ming.
Is there an easy way to use DirectX in Java? In particular, DirectX's video APIs.
I know that C# might be a more natural choice, but I have my devious reasons for wanting to do something so perverse.
I don't know about easy, but you could always use JNI to load the DirectX libs and invoke the methods.
Using something like Swig you could auto-generate a lot of the code.
Not sure how workable something like that would be though.
There seems to be a standard API about dealing with 3D inside Java.
It probably uses some kind of accelerating technology, may be even DirectX.
But I'm not sure about direct video support in this framework.
I create a library using BridJ (https://bridj.googlecode.com) that wrap DirectX classes, so you can use almost the same code than C++ examples.
You can find the library in https://bitbucket.org/fourthskyinteractive/directx-for-java.
Please, let me know about projects you develop.
There is a set of Direct3D bindings for Java available at http://java-direct3d.sourceforge.net/ but it seems that developement stopped in 2006 with DirectX 9.
Otherwise, there are OpenGL binding for java called JOGL.
The package that you want to investigate is the Java Media Framework (JMF). The core of it is pure Java, and per-platform "performance packs" provide acceleration via native libraries. It currently supports A/V capture and playback in a wide variety of data types as well as streaming via RTP and RTSP.
Sun's JMF home page
JMF SW/HW requirements
Minecraft is coded in Java with LWJGL, but Messiah Andrew's Renderer Wrapper converts the OpenGL to DirectX by using a modified version of the LWJGL libraries. Using these libraries, you should be able to code in LWJGL and have the game be running DirectX.
It seems that most are forgetting that JavaFX and Java3D support both DirectX and OpenGL using the best context for the machine you are on... well actually if you are on windows it attempts to load DirectX if it is newer than your OpenGL version.
I am not telling anyone to use either Java3D or JavaFX, but if you look at the source you can see how it is done.
GrepCode "good for looking for how things are implemented"
Open JavaFX "Open JavaFX project home" source
I should note that you want to look at the com.sun.prism package.
Java3D "Java3D project home" sources
I have been LEARNING development, LOL, for 20 years. Professionally for about 8 possible has never been the question, but how long, and/or is it worth it... Those are the questions.
Good luck my friend!
If you need any help I would be interested in creating a DirectX wrapper for java so
GIVE ME A SHOUT!