Thank you for visiting Blazing Games

Using the other tools

The JDK also includes some other tools. The three tools that would likely be used by people who are not using an IDE are jdb, jar, and javadoc.

jdb is a command-line java debugger. It is invoked with the command line jdb classname and once started you type in commands (use ? to get a list of commands) to do things like step through the program, set breakpoints, watch variables, modify variables, and other thinks you would do with an IDE debugger. If you don't have access to an IDE, this is usable, but an IDE with debugging support is much nicer to use.

jar is a utility for creating jar files. Jar files are collections of java classes that are combined and compressed into a single file. It is also possible to assign a main class to a jar file which allows the jar file to be ran with the java -jar option and many GUI's will actually run jar files that have a main class specified. The basic format for creating a jar file is jar c filelist. There are many other options, which are described in the jar documentation. We will cover this tool in much more detail once development of Magic Artillery is far enough along to warrant the use of jar files.

javadoc is used to automatically create documentation files by using javadoc formatted comments within your source code. You should definitely read the documentation on how to use this, but for those of you who do not read documentation files, I will be covering how to use javadoc formatted commenting in the next chapter, and will cover using the command line to generate documents once Magic Artillery is far enough along in development.

IDEs

As mentioned earlier, there are many IDEs available for java. Some IDEs are commercial products. A few of these commercial IDEs also have trial or free versions associated with them. There is also some open source IDEs that are available.

For Macintosh OS X users, the freely available project builder actually provides a really nice development environment for developing Java applications and applets. In fact, Project Builder running on my laptop is my main java development platform for developing applets and applications for my Blazing Games site. This is partially because I like OS X and partially to make sure that my site related work is kept totally separate from any consulting work that I may do.

If you are serious about developing in java, you should certainly look at a few IDEs and find one that works the way you want to work and that is within your price range.

Obfuscation

In addition to the tools that have been outlined in this chapter, there are many third party tools available. Some are free, others cost money. While I certainly don't have enough time or space to describe all the tools that are available, I will describe a tool that I feel is a necessity if you are going to be distributing your Java programs. This tool is an obfuscator.

I am sure many of you are wondering what does this tool do. One problem that Java class files have is that the virtual machine language that is produced is fairly easy to reverse engineer. What that means is that someone can take a class file, run it through a de-compiler, and end up with fairly readable source code (granted, without comments). The obfuscator helps prevent this by making sure all variable names in the class file are meaningless garbage, and by doing a few other tricks.

A side benefit of Obfuscation is that quite often the resulting class or jar files are smaller then before you started. If your obfuscator is able to remove unused code, the size savings can even be bigger.

Some IDE's, such as Borland's awesome JBuilder, come with an Obfuscator built in. It is also possible to buy a stand alone obfuscator. There are also some free Obfuscators available.

Previous Chapter 2 Contents Page 7 of 7 Book Contents Next

About - Privacy Policy - Contact - Links - FAQ
Copyright © 2004-2006 Blazing Games Inc. All Rights Reserved