0

I am trying to finds a way to install the Java SDK (javac) on Scientific Linux 64bit with yum or anyway.. Can someone please tell me the best what to do this so I can use maven for my builds etc

BrnVrn
  • 5
  • 1
techsjs2012
  • 525
  • 2
  • 6
  • 10

3 Answers3

2

Another option is to install the openjdk available via the distribution.

yum install java-1.7.0-openjdk java-1.7.0-openjdk-devel

ewwhite
  • 194,921
  • 91
  • 434
  • 799
1

Just download the SDK from Oracle, place it in a suitable directory like /opt/java.

chmod it, i.e.:

chmod 744 jdk-6u37-linux-x64.bin

unpack it, i.e.:

./jdk-6u37-linux-x64.bin

symlink it, i.e.:

ln -s jdk1.6.0_37/ jdk

set environment variables in /etc/profile.d/java.sh, e.g. (for ant but you get the idea):

export JAVA_HOME=/opt/java/jdk
export ANT_HOME=/opt/java/apache/ant
export PATH=${JAVA_HOME}/bin:${ANT_HOME}/bin:${PATH}

Cheers

HTTP500
  • 4,827
  • 4
  • 22
  • 31
0

Just download the JDK from http://www.oracle.com/technetwork/java/javase/downloads/index.html,

and If you receive this error, UNIX cannot find the compiler, javac. or javac: Command not found - after installing Java

Here's one way to tell UNIX where to find javac. Suppose you installed the JDK in /usr/local/jdk1.8.0. At the prompt you would type the following command and press Return:

/usr/local/jdk1.8.0/javac hello.java Note: If you choose this option, each time you compile or run a program, you'll have to precede your javac and java commands with /usr/local/jdk1.8.0/. To avoid this extra typing, you could add this information to your PATH variable. The steps for doing so will vary depending on which shell you are currently running.

Class names, 'hello', are only accepted if annotation processing is explicitly requested

If you receive this error, you forgot to include the .java suffix when compiling the program. Remember, the command is javac hello.java not javac hello.

For more details, consult this lecture "Creating a Hello World application" in this page. http://learnjavaeasy.com/course/learn-java-online-with-java-8-by-examples/