What tools do I need to install for Java Development?
I am newbie to Ubuntu and I need to install tools for Java development on that platform.
I see by the Ubuntu Software Center that I have this installed:
- OpenJDK java 6 runtime
- icedtea java 6 web start
- netbeans platform for building rich media desktop app in java
- openJDK java runtime, using hotspot JIT (headless)
what other stuff do I need to install to develop java and java mobile apps?
thanks.
Step 1: Install Debian packages (I always use Debian packages where possible).
sudo apt-get install openjdk-6-jdk
This installs the full Java 6 development kit,
Download and install netbeans from here Now you will need to install the NetBeans Mobility plugin, which provides support for J2ME development, and the Sun Wireless Toolkit (WTK), which provides the actual libraries to compile against.
Step 2: Install the NetBeans Mobility plugin. If you choose File -> New Project, you will find no way to create a J2ME project! You need to install the Mobility plugin. Close that, and choose Tools -> Plugins. Under Available Plugins, select Mobility (Category: Java ME). Install that. Now under File -> New Project, you will find Java ME. Choose to create a Mobile Application.
Step 3: Install the Sun Wireless Toolkit. Having chosen Mobile Application, you will be presented with a dialogue with a red error at the bottom: “No J2ME compatible platform is installed in the IDE. You need to have at least one J2ME compatible platform installed in the IDE.” So you’re still missing the actual library files required to compile J2ME apps. So after much searching, I found what I think is the correct download (but there are lots of similar ones with different versions): Sun Java Wireless Toolkit 2.5.1 for CLDC. You should pick the Linux version, and download it (it’s called sun_java_wireless_toolkit-2_5_1-linux.bin). Download it to your desktop, then run:
chmod +x sun_java_wireless_toolkit-2_5_1-linux.bin
./sun_java_wireless_toolkit-2_5_1-linux.bin
If it says
“No suitable Java interpreter was detected”
. Type “0″ to “Specify a path to a Java interpreter directory.” If you installed openjdk-6-jdk like I said above, it should be installed in /usr/lib/jvm/java-6-openjdk/bin/. You might have many Java bin directories installed. To find one, type ‘which jar’. This might give you a symlink (such as /usr/bin/jar). Use ‘stat /usr/bin/jar’ to follow the symlinks until you find the real location, such as the one above. You are asked to enter a directory to install WTK. Just pick somewhere out of the way, probably in your home directory unless you want to share it with other users.
Step 4: Add the WTK platform to NetBeans. Now that WTK is installed, we can fix the above issue in NetBeans. In the New Mobile Application dialogue (heading should be Install Platform), click Install SDK/Platform/Emulator. (You can access this from the Tools -> Java Platforms menu also). Click the Add Platform button, choose Java ME MIDP Platform Emulator, and then you will be asked to “choose a directory to search for platforms”. Choose the directory where you installed WTK. It should have a special icon. Now it should do some detection magic, and install a platform with a checked checkbox in the Add Java Platform window. Click Next a few times, and you will see the Java Platform Manager screen with a J2ME folder, and the “Sun Java(TM) Wireless Toolkit 2.5.1 for CLDC” under it. Now you can complete the wizard to create a mobile application with MIDP! It even has a checkbox to create a little “Hello World” app. Now to get the damn thing running …
Links
- How do I install Java?
http://java.sun.com/products/sjwtoolkit/download-2_5_1.html
http://blog.sudobits.com/2011/04/30/how-to-install-netbeans-ide-on-ubuntu-11-04/
- http://blog.sudobits.com/2011/04/30/how-to-install-netbeans-ide-on-ubuntu-11-04/
source
- Sun-java [jdk]
- Sun-jre-plugin
- Eclipse [with JDT plugin]
- Sun java web start
Some times Sun-java is required by Netbeans or Eclipse. If you have already installed open-jdk then do not need to install Sun-java. If you are new java IDE user then you can try Eclipse which is lite weight then Netbeans and also have good plugin support for mobile device (android). If you want to develop mobile application then i recommend to use Eclipse. Maybe Sun-jre-plugin is useful. To run java applet application in firefox you need jre-plugin.
Happy Coding...
There is no reason to be desperate. I understand that by Java mobile application you are referring to Android native application. For this purpose I would recommend installing the Sun SDK instead along with Eclipse.
You can download the Eclipse classic from their download site.
Once you have Eclipse insalled (it is just a zip file that you need to unzip to a directory of choice) you will need to install the Android Developers Tools (ADT) by following the installation instructions.
Sun SDK + Eclips + ADT is about all you need to start developing your first Android application.