0

this one does not fly for me: http://pastebin.com/Mctnidng It was elaborated in this forum under a different thread. I've divided it into two files

AlphabetHelper.java

AlphabetHelperTest.java 



java  -version
java version "1.6.0_18"
Java(TM) SE Runtime Environment (build 1.6.0_18-b07)
Java HotSpot(TM) Server VM (build 16.0-b13, mixed mode)

javac  -version
javac 1.6.0_18

on attempt to compile I included some

import java.util.Random;
import java.util.logging.Logger;
import java.util.List;
import java.math.BigInteger;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

But it does not take of. I assume there must be some other Java distribution out there, apache or android. The code however looks quite good, how can I get to run on my Java 1.6? Most oder Java sourcode works fine on my machine.

javac  -Xlint  AlphabetHelper.java
AlphabetHelper.java:41: cannot find symbol
symbol  : variable ArrayUtils
location: class AlphabetHelper
                ArrayUtils.toObject(
                ^

javac -Xlint  AlphabetHelperTest.java
AlphabetHelperTest.java:5: cannot find symbol
symbol  : class Random
location: class AlphabetHelperTest
    private Random random;
            ^

AlphabetHelperTest.java:8: cannot find symbol
symbol  : class Logger
location: class AlphabetHelperTest
    private static final Logger LOG = LoggerFactory.getLogger(AlphabetHelperTest.class);
                         ^

it is all about this file http://pastebin.com/Mctnidng to be compiled tested and deployed on Java 1.6

Sincerely,

helderdarocha
  • 23,209
  • 4
  • 50
  • 65
  • It's not clear from your question what the problem is. What is happening that you don't like? The compiler errors? Please provide more information. – elixenide Feb 28 '14 at 20:23
  • 1
    The file in the link has no imports at all. When you compile that code, are you using the imports above? Also, I don't see "ArrayUtils" imported anywhere. It's not a standard rt.jar class. – Paul Hicks Feb 28 '14 at 20:40
  • I created two files: AlphabetHelper.java AlphabetHelperTest.java and imported the most likely needed imports. After asking on IRC they told me most likely it was a different distribution than OpenJDK or the to me known stable JDK. ArrayUtils.toObject() was reported to be a non JDK class. import org.apache.commons.lang.ArrayUtils; could be useful, but I've never done such an import. I think it may be the solution, but then it is no more java as defined by sun. It was discussed in this question http://stackoverflow.com/questions/2863954 and reported as a solution, which I am now examining. – 藻留天 具留部覧度船 Mar 02 '14 at 18:15

0 Answers0