This week's book giveaway is in the Other Open Source APIs forum. We're giving away four copies of Storm Applied and have Sean Allen, Peter Pathirana & Matthew Jankowski on-line! See this thread for details.
Ok I'm thoroughly confused. I have a Java pgm, that runs fine on my PC in a Jvm 1.2, however, it throws a method not found error on a line that calls the nextInt method in the java.util.Random class, on the AS400 which is running Jvm 1.1.7. So, without looking , I figured, Random.nextInt, was not a method for 1.1 Well, I checked and I figured wrong. Random.nextInt is in 1.1 So what�s the deal? Do I need to compile the class on the AS400? I�ll try that tomorrow, but I thought it was �run anywhere�. Looking for a little enlightenment. Thanks, in advance.
Anxiety does not empty tomorrow of its sorrows, but only empties today of its strength. – Charles Spurgeon
Perhaps you have your classpaths set up differently on the different machines???
"JavaRanch, where the deer and the Certified play" - David O'Meara
Joined: Jan 12, 2000
No, I figured it out today. Sun's class libraries cleared it up. The java.util.Random.nextInt method is different in 1.1 than 1.2 By compiling the class directly on the AS400 I found the problem. In 1.1 there are no parameters for the method. In 1.2 you can supply an int parameter to limit the random selection. All I had to do was divide mudulo the random result and flip and negatives to positive and boom, it worked! The software required a positive int 0 to 255.