This post will show how to set up Oracle JDK 8 on pcDuino.
That lesson we discuss about “How to Install JDK 8 on pcDuino ” http://learn.linksprite.com/pcduino/java/how-to-install-jdk-8-on-pcduino/
But We want to Set default java and javac to the new installed jdk8.
How ?
Let’s make it happen : )
ubuntu@ubuntu:~$ sudo update-alternatives --install /usr/bin/javac javac /opt/jdk1.8.0/bin/java 1 ubuntu@ubuntu:~$ sudo update-alternatives --install /usr/bin/java java /opt/jdk1.8.0/bin/java 1 ubuntu@ubuntu:~$ sudo update-alternatives --config javac There is only one alternative in link group javac: /opt/jdk1.8.0/bin/java Nothing to configure. ubuntu@ubuntu:~$ sudo update-alternatives --config java There are 2 choices for the alternative java (providing /usr/bin/java). Selection Path Priority Status ------------------------------------------------------------ 0 /usr/lib/jvm/java-6-openjdk-armhf/jre/bin/java 1057 auto mode * 1 /opt/jdk1.8.0/bin/java 1 manual mode 2 /usr/lib/jvm/java-6-openjdk-armhf/jre/bin/java 1057 manual mode Press enter to keep the current choice[*], or type selection number: 1 ubuntu@ubuntu:~$ java -version java version "1.8.0" Java(TM) SE Runtime Environment (build 1.8.0-b132) Java HotSpot(TM) Client VM (build 25.0-b70, mixed mode) ubuntu@ubuntu:~$ javac -version java version "1.8.0" Java(TM) SE Runtime Environment (build 1.8.0-b132) Java HotSpot(TM) Client VM (build 25.0-b70, mixed mode) ubuntu@ubuntu:~$ java Usage: java [-options] class [args...] (to execute a class) or java [-options] -jar jarfile [args...] (to execute a jar file) where options include: -d32 use a 32-bit data model if available -d64 use a 64-bit data model if available -client to select the "client" VM -server to select the "server" VM -minimal to select the "minimal" VM The default VM is client. -cp <class search path of directories and zip/jar files> -classpath <class search path of directories and zip/jar files> A : separated list of directories, JAR archives, and ZIP archives to search for class files. -D<name>=<value> set a system property -verbose:[class|gc|jni] enable verbose output -version print product version and exit -version:<value> require the specified version to run -showversion print product version and continue -jre-restrict-search | -no-jre-restrict-search include/exclude user private JREs in the version search -? -help print this help message -X print help on non-standard options -ea[:<packagename>...|:<classname>] -enableassertions[:<packagename>...|:<classname>] enable assertions with specified granularity -da[:<packagename>...|:<classname>] -disableassertions[:<packagename>...|:<classname>] disable assertions with specified granularity -esa | -enablesystemassertions enable system assertions -dsa | -disablesystemassertions disable system assertions -agentlib:<libname>[=<options>] load native agent library <libname>, e.g. -agentlib:hprof see also, -agentlib:jdwp=help and -agentlib:hprof=help -agentpath:<pathname>[=<options>] load native agent library by full pathname -javaagent:<jarpath>[=<options>] load Java programming language agent, see java.lang.instrument -splash:<imagepath> show splash screen with specified image See http://www.oracle.com/technetwork/java/javase/documentation/index.html for more details.
Leave a Reply
You must be logged in to post a comment.