- Install JRE & JDK (java runtime environment with JAVA DEVELOPMENT KIT )
sudo apt-get install openjdk-8-jre openjdk-8-jdk
- Verify
JAVA
tools are available onCONSOLE
by typingjava
following aTAB
character.
java javac javadoc javah javap # default tools avail once jdk installed
- Download a Helloworld program for learning purpose. Here’s one from Oracle’s site on HelloWorldSwing
- Create a
workspace
directory for better practice and move the source code there. - On terminal run and execute.
javac HelloWorldSwing.java
java HelloWorld - You can now able to see Java Swing Window with
Helloworld
Update: MySQL Connectivity
- Install MySQL-LIB for JAVA
sudo apt-get install libmysql-java
- Setup MySQL Schema and Tables
CREATE DATABASE feedback; USE feedback; CREATE TABLE comments ( id INT NOT NULL AUTO_INCREMENT, MYUSER VARCHAR(30) NOT NULL, EMAIL VARCHAR(30), WEBPAGE VARCHAR(100) NOT NULL, DATUM DATE NOT NULL, SUMMARY VARCHAR(40) NOT NULL, COMMENTS VARCHAR(400) NOT NULL, PRIMARY KEY (ID) ); INSERT INTO comments values (default, 'thulasi', 'hi@kesavan.info', 'https://kesavan.info', now(), 'Summary','My first comment' );
- For learning purpose , download a sample source from vogella
- Execute the compile & main class
javac Main.java
java Main - You can now able to see the data from MySQL DBMS. Good luck!