How can i get a java complier for linux and ubuntu?
@sasogeek @wio
google will help best type in adobe
As root: yum install java-1.7.0-openjdk java-1.7.0-openjdk-devel I also have: gcc-java which is a Java frontend for gcc, so that standalone executables can be compiled. No jvm needed.
so i have to install java -1.7.0-openjdk java-1.7.0-openjdk-devel? this will work for both? @rsmith6559
@Jaynator495
YUM is for Red Hat like distros if I recall correctly. Ubuntu uses apt-get, the following commands work for installing JRE, and JDK. ``` sudo apt-get update sudo apt-get install default-jre sudo apt-get install default-jdk ``` After installing, you may want to check out ```java -version``` to know what version you are working with.
i should type this in terminal
Yup.
i gave the 1st command
i opened the link
now?
The program 'java' can be found in the following packages: * default-jre * gcj-4.8-jre-headless * openjdk-7-jre-headless * gcj-4.6-jre-headless * openjdk-6-jre-headless Try: sudo apt-get install <selected package>
Run the command: sudo apt-get install default-jdk
look Need to get 61.7 MB of archives. After this operation, 106 MB of additional disk space will be used. Do you want to continue? [Y/n]
Hit the 'y' key, and then hit enter.
okay
its showing that % symbol
so it should be 100% till then we have to wait right
Yup, currently it is fetching the files. Once that is done, it will install them.
okay could you wait?
like if u r free then
ah i see u dont accept messages you may be knowing java, python and all right
After the command finishes you will have the full featured Software Development Kit for Java. There really is not much else to it. There is not supposed to be any accept messages.
what will be the name of the application?
Adding debian:GTE_CyberTrust_Global_Root.pem done. Setting up libatk-wrapper-java (0.30.4-4) ... Setting up libatk-wrapper-java-jni:amd64 (0.30.4-4) ... Processing triggers for libc-bin (2.19-0ubuntu6.6) ... Processing triggers for ca-certificates (20141019ubuntu0.14.04.1) ... Updating certificates in /etc/ssl/certs... 0 added, 0 removed; done. Running hooks in /etc/ca-certificates/update.d.... done. done.
now it shows the command again
To compile you can use: javac filename.java To run your Java program you can use: java filename
so i should type the commands in terminal
or in pluma?
Well do you have Java source code to compile?
ah im totally new to this
Oh, okay. Well, javac is the java compiler, notice the c on the end of java which denotes that that command calls the Java compiler. java is the command used to run Java programs, after they have been compiled.
okay well javac will run the java commands right
When you say Java commands do you mean, compile the Java source code of a file, into a binary executable that you run, then yes.
yay okay well how can i create a java file?
Do you mean create programs? Before that, you have to learn Java programming.
yeah but where can i create so that i can use javac
Open up a text editor, write a simple, "Hello World" program in Java, save it as HelloWorld.java Then go inside your terminal, locate where HelloWorld.java is, and cd into that directory, then run javac HelloWorld.java, which will compile your source code.
oh so i need text editor
Pluma will work?
Is Pluma a text editor? If so then yes, virtually any text editor works.
how ? like i saved it on desktop what should i type? javac hello.java
What did you save it as?
Hello.java on desktop
cd ~/Desktop javac Hello.java
no not working
What does it say?
javac: file not found: Hello.java
Did you cd into the directory where you saved the file?
well what does that mean?
Did you run this command: cd ~/Desktop cd means, change directory it is a command line way to switch between directories.
@rvc I have to go, hopefully in the mean time someone else can try to help you out. Good luck.
okay thank you so much for help @Opcode
Join our real-time social learning platform and learn together with your friends!