Using Java with Windows 10

I’m starting to get more requests for information about using the materials in Java eLearning Kit for Dummies with Windows 10. Java for Dummies eLearning Kit is designed for use with Windows 7, Linux, or Mac OS X, and Java 7. However, as mentioned in the Java 7 Patches and Future post, I’ve tested enough of the code with Java 8 to feel fairly certain that the book will also work fine with Java 8. Unfortunately, using the book with Windows 10 will prove problematic.

The Windows 10 and Java FAQ sheet tells you about the some of the issues in using Java with the new operating system. For example, you can’t use the Edge browser with Java because it doesn’t support plug-ins. You need to install a different browser to even contemplate using Java eLearning Kit for Dummies—I highly recommend Firefox or Chrome, but the only requirement is that the browser support plugins.

Because Java eLearning Kit for Dummies is supposed to provide you with a more intense than usual learning experience, using Windows 10 is counterproductive. For example, none of the procedures in the book will work with Windows 10 because even the act of accessing the Control Panel is different. With this in mind, I truly can’t recommend or support Windows 10 users for this particular book without saying that your learning experience will be less complete than I intended when I wrote the book.

There is still no timeline from the publisher for creating an update of this book. If you really want a Windows 10 version of this book, then you need to contact the publisher directly at http://www.wiley.com/WileyCDA/WileyTitle/productCd-1118098781.html and ask for it. If you have any book-specific questions, please feel free to contact me at John@JohnMuellerBooks.com.

 

Java 7 Patches and Future

It’s always important to keep your software updated with the latest patches. This is especially true with Java because so many hackers target even the smallest weaknesses. According to a recent ComputerWorld article, Java 7 has reached the end of its public life for updates. You need to upgrade to Java 8 in order to continue receiving free updates from Oracle. The rapid pace of updates that vendors rely on now is made necessary by hackers who apparently create malware updates even faster. Even at the fast release pace that Oracle is using, the malware just keeps rolling out. In other words, as a developer you need to exercise proactive coding to keep security risks at bay, in addition to relying on Oracle and other vendors for help.

A number of people have asked me about updates to Java eLearning Kit for Dummies. As far as I know, the publisher currently doesn’t have plans for an update. Of course, that could change at some point. Until the next update, however, the examples I’ve tested with Java 8 work fine on a Windows system. I’ll be performing additional testing on both OS X and Linux. However, I don’t have quite the number of people testing the book code as I had when I wrote it. If anyone does encounter a problem with the code, I’d greatly appreciate hearing about it at John@JohnMuellerBooks.com. I can’t guarantee that I’ll be able to fix absolutely every issue, but I’ll try to find workarounds and publish them on the blog for you.

As always, please don’t send me your personal code—I only work with book-specific code. Using the downloadable source is always the best way to get the most you can from a book. I’ve also created the Using My Coding Books Effectively post to help you get the most from my books. It’s important to me that you get the most you can from my books.

 

Viability of Java Programming as a Job

I get a lot of e-mail from readers asking whether I can tell them about their chances of getting a job using a particular programming language or skill that I write about. There are so many factors to consider in answering that question that it really is impossible to answer correctly or with any accuracy. Books, such as Java eLearning Kit for Dummies, provide you with a marketable skill that can potentially land you a job. In fact, The Importance of Finding Work post provides you with some ideas on just where you can find an interesting job writing Java code. I can also tell you that Java is both popular and important as far as programming languages are concerned. A recent InfoWorld article, Good news, Java developers: Everyone wants you, literally screams opportunity in the title. You can find further confirmation in the recent TIOBE index that places Java as the second most popular language in the world. All these indicators tell you that Java is a good selection for success.

Whether you can get a job programming with Java is an entirely different story. For example, there isn’t any way I can judge your skill at using Java, so there is no way I even know if you’re able to write applications. Being able to use Java to write applications is a prerequisite to getting the job, so only you know what your chances are in this area. If you’re honest with yourself, you know your skill level and whether you really do need more time practicing your skills before you go in for a job interview. Being realistic about your chances of getting a particular job is also important. If you try to get a leadership position with beginner skills, be prepared for disappointment.

If I could limit the criteria to issues such as job availability and your personal skills, I might be able to answer your question with some degree of success. However, the question is far more complex than that. A glut in people with basic skills could affect your chances of getting a job in a particular area. Likewise, if employers are looking for someone, anyone, to fill a position, you might get into a really good position with lackluster skills.

How you present yourself to a potential employer also affects the potential for success. Many highly skilled developers lack the kind of self-confidence required to get a job. The person in HR will see your interpersonal skills, not your ability to write code. Unless you have an in with the department you want to work with, trying to convince someone in HR to let the interview process go further could be quite hard.

I really do want you to succeed. So, I’ll continue to provide you with ideas of where to find work and the popularity of the skills that I’m helping you obtain. Unfortunately, my ability to provide help beyond these two areas is limited. In most cases, the rest is up to you. In keeping with the idea of preparing you as fully as I can to get that job of your dreams, I’m always open to answering your book-specific questions. Always feel free to contact me at John@JohnMuellerBooks.com.

 

The Importance of Finding Work

Readers sometimes show patterns in the questions they ask and, in some cases, the pattern shows across a number of my books. When I started to note that readers were interested in discovering just how to earn a living once they have developed a new skill and that they were interested in me providing that information, I started adding a new section to many of my books, such as MATLAB for Dummies, that describes what sort of industries could use the skills the reader has learned. However, I don’t want anyone to be bored to tears either, so I made a point of listing interesting vocations. It’s my feeling that readers want to be engaged in their work. Of course, jobs with less pizzazz are always available and you might have to accept one of them—at least in the short term.

I didn’t provide such a listing for Java eLearning Kit for Dummies. My thought was that Java jobs are so plentiful that readers could probably find a job they liked without too much trouble. However, even with this book, I’ve received more than a few queries about the issue. That’s why I wrote 10 Surprisingly Interesting Ways to Earn a Living Using Java recently for New Relic. As with all my other job listings, this article focuses on jobs that could be really interesting and most definitely rewarding. Of course, not every job is for every person out there—you need to read the article to find the kind of job you like best.

One reader actually did ask why I focused my efforts on interesting (or at least, unusual) jobs. It all comes down to my personal vision of work. I get up every morning with all kinds of cool ideas to try for my books. I actually like opening my office door, starting up my systems, and getting down to writing. For me, work is an enjoyable experience—so much so, that I often forget that it’s work. I’d like other people to have that experience—to have the joy of enjoying their work so much that they really hate to leave at the end of the day.

Of course, there are other languages out there and I have other books that lack lists of jobs. If you find that one of my books is lacking this sort of information, and you really would like me to research the kinds of jobs that are available, let me know at John@JohnMuellerBooks.com. I’d like to hear which book should receive a listing of associated jobs next. In the meantime, be sure to enjoy the Java job listing. You might see your dream job listed, you know, the one you didn’t think existed.

 

Updating Your Copy of Java

It’s almost never a good idea to keep really old versions of software on your system that provide some sort of security or Internet access functionality. One of the worst technologies in this regard is Java. It seems like everyone wants to pick on every security flaw found in Java, probably because the language is so incredibly popular and it’s available on just about every platform on the planet. There have been all sorts of attempts by vendors to remove Java because it’s perceived as such a problem. Microsoft is now trying to take some action regarding Java. You can read the full details in Microsoft to block outdated Java versions in Internet Explorer on ZDNet. However, the short version is that if you’ve been holding off updating your copy of Java, you can’t wait much longer and expect it to continue working.

Of course, this news brings me to my books. A number of my books either discuss Java directly or rely on Java in some other way that depends on Internet Explorer support. For example, when working with Java eLearning Kit for Dummies, you need to use Java and if you’re working on the Windows platform, it’s likely that you’re using Internet Explorer. If you’ve also been limping along with that really outdated copy of Java, the examples in the book may not work after Tuesday (August 12). Microsoft has a way of slipping in updates at times in ways that people really don’t catch until it’s too late.

Mind you, I think this is a good update because old software is just too easy exploit by those nefarious individuals trying to steal your credit information and turn your computer into a zombie. Of course, updates can create havoc with book examples as well. If you do perform an update and find that you’re having a problem with an example that used to work in books that rely on Java, please be sure to let me know about it at John@JohnMuellerBooks.com. I want to ensure your book examples continue to run even after the much needed update.

 

Practice Icon on Page 59

A number of you have written to ask me about the Practice icon on page 59 of Java eLearning Kit for Dummies. It turns out that the practice won’t quite work as originally written because Java’s Random class now ensures that you get a random number each time you call it. As a result, the original practice no longer works.

In order to obtain consistent results from the example, you would need to set the seed to the same value every time. Here is an example of what I mean:

// Import the required API classes.
import java.util.Scanner;
import java.util.Random;
import java.util.Calendar;
 
public class ShowInt
{
    public static void main(String args[])
    {
        // Create the scanner.
        Scanner GetInt = new Scanner(System.in);
         
        // Obtain an int value.
        System.out.print("Type a number between 1 and 10: ");
        int YourGuess = GetInt.nextInt();
         
        // Get the current time.
        Calendar MyCal = Calendar.getInstance();
         
        // Create a random number generator.
        Random MyRandom = new Random();
         
        // Set the seed value for the random number using
        // the current number of milliseconds in the time.
        //MyRandom.setSeed(MyCal.getTimeInMillis());
        MyRandom.setSeed(5);
         
        // Obtain a random number between 1 and 10.
        int MyGuess = MyRandom.nextInt(10) + 1;
         
        // Display the value on screen.
        System.out.print("Your guess was: " + YourGuess);
        System.out.println(" My guess was: " + MyGuess);
    }
}

Notice that I’ve commented out the original MyRandom.setSeed(MyCal.getTimeInMillis()); line that ensures you get a more random result every time and added a new MyRandom.setSeed(5); line that sets the seed to the same value every time. Now when you run the example, you get the same value every time. On my system, the example guesses 8 every time.

This change to the practice should produce the desired result. I’m sorry about any confusion the original practice may have causes. Please let me know about any other book-related concerns at John@JohnMuellerBooks.com.

 

Continuing Education

I don’t know if you’ve noticed, but I’m continually asking questions in my blog posts. In fact, you can find questions in a few of my books and more than a few readers have commented when I ask them questions as part of my correspondence with them. I often get the feeling that people think I should know everything simply because I write books of various sorts. In fact, I had to write a post not long ago entitled No, I Don’t Know Everything to address the issue. Experts become experts by asking questions and finding the answers. They remain experts by asking yet more questions and finding yet more answers. Often, these answers come from the strangest sources, which means that true experts look in every nook and cranny for answers that could easily elude someone else. Good authors snoop more than even the typical expert—yes, we’re just plain nosy. So, here I am today asking still more questions.

This year my continuing education has involved working with the latest version of the Entity Framework. The results of some of my efforts can be found in Microsoft ADO.NET Entity Framework Step by Step. You can also find some of my thoughts in the Entity Framework Development Step-by-Step category. I’ve been using some of my new found knowledge to build some applications for personal use. They may eventually appear as part of a book or on this blog (or I might simply choose to keep them to myself).

However, my main technical focus has been on browser-based application technology. I think the use of browser-based application technology will make it possible for the next revolution in computing to occur. It certainly makes it easier for a developer to create applications that run anywhere and on any device. You can find some of what I have learned in two new books HTML5 Programming with JavaScript for Dummies and CSS3 for Dummies. Of course, there are blog categories for these two books as well: HTML5 Programming with JavaScript for Dummies and Developing with CSS3 for Dummies. A current learning focus is on the SCAlable LAnguage (SCALA), which is a functional language (akin to F# and many other languages of the same type) based on Java.

Anyone who knows me very well realizes that my life doesn’t center on technology. I have a great number of other interests. When it comes to being outdoors, I’ve explored a number of new techniques this year as I planted some new trees. In fact, I’ll eventually share a technique I learned for removing small tree stumps. I needed a method for removing stumps of older fruit trees in order to plant new trees in the same location.

I’ve also shared a number of building projects with you, including the shelving in our larder and a special type of dolly you can use for moving chicken tractors safely. Self-sufficiency often involves building your own tools. In some cases, a suitable tool doesn’t exist, but more often the problem is one of cost. Buying a tool from the store or having someone else build it for you might be too expensive.

The point I’m trying to make is that life should be a continual learning process. There isn’t any way that you can learn everything there is to learn. Even the most active mind picks and chooses from the vast array of available learning materials. No matter what your interests might be, I encourage you to continue learning—to continue building your arsenal of knowledge. Let me know your thoughts on the learning process at John@JohnMuellerBooks.com.

 

Thinking Through Indentation and IDE Automation

I’ve been asked a number of times about code indentation in my books by publishers, editors, and readers alike, so I thought it might be a good idea to talk about the matter in a blog post. It’s important to indent your code to help make the code more readable—to help make the flow of your code easier to see. Each indentation represents another code level. The application is at one level, classes at another, methods within the class at another, loops within a method at still another, and so on. By viewing the various levels of code within an application, you see an outline of application functionality and can better understand how each application element works. Because indentation is so important to the understanding of code, I spend considerable time working through indentation in my books so that you can better understand the examples I present.

Indentation is there for the developer to use as an aid to understanding. A few early computer languages, such as COBOL, were positional and depended on coding elements appearing in certain positions on each line. Most languages today don’t require that you use any sort of indentation. In fact, more than a few languages would let you write the entire application on a single line without any indentation at all (as long as you supplied a space between statements and expressions as needed). The compiler doesn’t care whether you indent using spaces or tabs, whether there are three or four spaces per indent, or whether you provide an indent for continued lines. The fact is that all of these characteristics are controlled by the developer to meet the developer’s needs.

Modern IDEs make it easy to indent your code as needed by performing the task automatically in some cases. For example, given an example of a Java method, you could begin by typing:

public void MyProc()
{

The moment you press Enter after the curly bracket (}), most IDEs will add an indented line and a closing curly bracket. Your cursor will end up on the indented line, ready for you to type a statement. You see something like this in your IDE:

public void MyProc()
{
 
}

The developer hasn’t done anything so far to provide indentations for the code, yet the code is already indented. Let’s say you create a variable like this:

boolean MyVar = true;

You then type a statement like this:

if (MyVar == true)

It’s at this point where some IDEs continue to provide an automatic indent and others don’t. For example, if I press Enter at the end of this line in Eclipse, the IDE automatically indents the next line for me. However, when I’m working with CodeBlocks, pressing Enter leaves the code at the same indention level as before. Neither approach is wrong or right—simply different. If I were to add a curly bracket on the next line to hold multiple lines of code within a block, CodeBlocks will already have the cursor in the right position and Eclipse will have to outdent the curly bracket to position it correctly.

Let’s say that this if statement has just one line of code following it, so I don’t use a curly bracket. When working with Eclipse, the cursor is already at the correct position and I simply type the next statement. However, when working with CodeBlocks, I must now press Tab in order to indent the line of code to show that this line (and only this line) is associated with the if statement. In this case, the example simply outputs a statement telling the value of MyVar like this.

System.out.println("MyVar == true");

Pressing Enter automatically outdents the line when using Eclipse because the next statement is automatically at the same level as the if statement. However, when working with CodeBlocks, I must press the Backspace to outdent the line manually. The resulting method could end up looking like this:

void MyProc()
{
    boolean MyVar = true;
    if (MyVar == true)
        System.out.println("MyVar == true");
     
}

Of course, a good developer will add some comments to this code as a reminder of what task the code performs and why the developer chose this particular technique to perform the task. The point of this post is that indentation is an essential part of working with most languages in order to make the resulting application easier to understand.

A final thought on IDEs is that most of them make it possible to configure the editor to indent or not indent to meet the requirements of your organization or personal tasks. IDEs commonly allow the use of tabs or spaces for indents (spaces are better when you want to write documentation). You can also choose the right amount of indentation (three spaces is optimal for books where space is limited). Let me know your thoughts on indentation and how you use it at John@JohnMuellerBooks.com.

 

Java 7 Released for General Use

Developers have been using Java 7 for quite some time now for creating and testing applications with additional functionality. However, until May 2nd, Java 7 wasn’t made generally available for users. Oracle plans to upgrade the entire user base at this point, so now is the time to start thinking about deploying those applications you’ve been developing. Just in case you’re new to Java programming, you can use my latest book, Java eLearning Kit for Dummies to learn how to work with Java quickly using the Windows, Linux, or Macintosh operating systems. The accompanying CD provides a fully interactive environment that includes impromptu tests and animation, to make learning a lot more fun. You can read the Java eLearning Kit for Dummies Manuscript Finished to get more information about the book. Be sure to contact me at John@JohnMuellerBooks.com if you have any questions about this new offering.

This new version of Java has a lot to offer. For example, it’s the first time Oracle has provided both the Java Development Kit (JDK) and JavaFX Software Development Kit (SDK) for the Macintosh OS X. You can find a quick overview of why you should upgrade to Java 7 on the Oracle site. A more complete, developer friendly, list of changes appears on the OpenJDK site. Long time Java developers say there is nothing earth shattering in the upgrade, but there are a wealth of welcome enhancements. Just which enhancement is most important depends on which developer you talk to. Java eLearning Kit for Dummies discusses which of these enhancements are most important to beginning developers—those targeted by my book. I would say that the feature that intrigues me most is the improved support for dynamic languages—a feature I may try out soon. You can find the official Oracle feature list on their site at http://www.oracle.com/technetwork/java/javase/jdk7-relnotes-418459.html.

Of course, now that Java 7 is out everyone is already starting to discuss Java 8. (In fact, some people are already talking about Java 9.) As with any new project, there are a lot of ideas and vaporware right now, with a true lack of any substance. You can be sure that I’ll keep you updated on the progress of Java 8. In the meantime, if you choose to get my book, I’d love to hear from you. Let me know what you like and what you’d like to see improved in the next edition. However, whatever you do, don’t keep silent if you have a question. I really do want to help you get the most out of everything I write.

 

Java eLearning Kit for Dummies Manuscript Finished

Nothing excites me more than to complete the manuscript for another book. I actually completed the Java eLearning Kit for Dummies manuscript last week Wednesday, but there are always last minute things to do. Today I’m considering the manuscript for book number 89 done. At this point, I’m working on Author Review (AR)—a process where I interact with the various editors. I answer any questions they might have about my book’s content and also check their edits to make sure no mistakes have been introduced.

This book is really exciting for a number of reasons. First of all, it’s a carefully crafted tutorial. Even if you’re a complete novice, you should be able to use this book. Every term is defined, the code is fully documented, and you shouldn’t run into any unpleasant surprises where the author assumes that you know something that you don’t. In fact, this book had a total of 15 beta readers involved in reviewing the material, in addition to my ever faithful editors. Of course, being precise and careful doesn’t mean you won’t have questions and I always welcome your questions about any book I write.

Second, this book is intended for use on multiple platforms. It doesn’t matter whether you work on a Linux, Macintosh, or Windows machine—you can use this book to learn how to write basic Java applications. Creating a book that works on so many platforms is exhilarating in the extreme. I couldn’t have done it without the support of my beta readers and I wish to thank every one of them publicly. You’ll find the names of the beta readers who didn’t mind me mentioning them in the Acknowledgements when the book is released.

Third, this book is the first I’ve ever written that comes with an interactive CD. You don’t really have to read anything if you don’t want. I estimate that you can get upwards of 85% of the content of the book simply by listening to the CD. Of course, books on tape have been providing this service for a long time. The difference with this book is that the CD is interactive. Not only will you hear the text, but you’ll see animations demonstrating the various things you need to know about Java. A number of different quiz types will test your knowledge of Java as you progress through the book. Finally, you’ll work through hands on exercises in order to build your skills. In short, this book includes everything that some of the newer interactive books include, but in a form that works on any computer system.

It’s important for any buyer to understand that this book truly is intended for novice readers. You aren’t going to get an intense Java workout by reading this book. In fact, here is a list of the lessons in the book:

 

  • Lesson 1: Starting With Java
  • Lesson 2: Using Primitive Variables
  • Lesson 3: Using Object Variables
  • Lesson 4: Formatting Variable Content
  • Lesson 5: Working with Operators
  • Lesson 6: Working with Conditional Statements
  • Lesson 7: Repeating Tasks Using Loops
  • Lesson 8: Handling Errors
  • Lesson 9: Creating and Using Classes
  • Lesson 10: Accessing Data Sets Using Arrays and Collections
  • Lesson 11: Performing Advanced String Manipulation
  • Lesson 12: Interacting with Files
  • Lesson 13: Manipulating XML Data


Nothing here is earth shattering, but you do get a good basic knowledge of Java. By the time you’re finished, you’ll know enough to move on to the harder to understand tutorials you find in books and online. In order to demonstrate all of the techniques in these topics, you’ll find 101 fully documented examples. Each one is designed for you to work through and interact with so that you fully understand precisely how Java works on your platform.

I’ll be working on the CD for the next while. As soon as it’s finished, I’ll provide you with an update about the CD content. For example, I’ll let you know a bit more about the kinds of exams I’m providing. Let me know if you have any questions about my new book at John@JohnMuellerBooks.com.