java

Glassfish

https://glassfish.java.net/download.html
http://download.oracle.com/glassfish/4.1/promoted/index.html

# parameter
grep pass /etc/init.d/glassfish
ASADMINOPTS="--user admin --passwordfile /opt/glassfish/pass"

# asadmin
http://docs.oracle.com/cd/E19798-01/821-1758/6nmnj7pso/index.html
/opt/glassfish/bin/asadmin --user admin --passwordfile /opt/glassfish/conf/pass list-jvm-options | grep Dcom.sun.management.jmxremote.port
/opt/glassfish/bin/asadmin --user admin --passwordfile /opt/glassfish/conf/pass create-jvm-options -Dcom.sun.management.jmxremote.port=1234

Install SQL developer

Get Oracle SQL Developer package
1. go to Homepage: http://www.oracle.com/technology/software/products/sql/index.html
2. accept the licence
3. login
4. download "Oracle SQL Developer for other platforms"

#http://download.oracle.com/otn/java/sqldeveloper/sqldeveloper-4.1.0.18.37-no-jre.zip
http://download.oracle.com/otn/java/sqldeveloper/sqldeveloper-17.4.1.054.0712-no-jre.zip

<?php
$URL="https://raw.githubusercontent.com/panticz/installit/master/install.sqldeveloper.sh";
echo "wget $URL-qO - | bash -s /tmp/sqldeveloper-17.4.1.054.0712-no-jre.zip";
echo "

";
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $URL);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
echo htmlspecialchars(curl_exec($c));
curl_close($c);
echo "

";
?>

# reduced memory usage
sed -i 's|-Xmx640M|-Xmx384M|g' /opt/sqldeveloper/ide/bin/ide.conf

# ToDo
# http://download.oracle.com/otn/java/sqldeveloper/sqldeveloper-4.0.2.15.21-1.noarch.rpm?AuthParam=XXX_XXX
# use a repository
# configure global

Install NetBeans

<?php
$URL="https://raw.githubusercontent.com/panticz/installit/master/install.netbeans.sh";
echo "wget $URL -O - | bash -";
echo "

";
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $URL);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
echo htmlspecialchars(curl_exec($c));
curl_close($c);
echo "

";
?>

# configure jdk
# echo netbeans_default_options="netbeans_default_options="--jdkhome" | sudo tee -a /opt/netbeans/etc/netbeans.conf
# Cannot find java. Please use the --jdkhome switch

Add git repository
https://www.youtube.com/watch?v=mzzAUEFS4vs
https://netbeans.org/kb/docs/ide/github_nb_screencast.html

OPTIONAL: install MySQL driver
sudo apt-get install libmysql-java

DEP: fix ubuntu locale settings for german
sed -i 's|en_US.UTF-8|de_DE.UTF-8|g' /etc/scim/global

DEP: disable compiz effects (Visual Effects (System > Preferences > Appearance > Visual Effects => none)
metacity --replace &

Fix bold fonts under Linux
sudo apt-get remove -y fonts-unfonts-core

Ansible role
git clone https://github.com/panticz/ansible.git /tmp/ansible
cd /tmp/ansible/
export ANSIBLE_ROLES_PATH=$(pwd)/roles
ansible-playbook -K /dev/stdin <Links
http://www.techytalk.info/netbeans-cannot-find-java-please-use-jdkhome-switch/ - HowTo (re)configure JAVA JDK
http://wiki.netbeans.org/NBPackagingPlan

Connect to MySQL DB

# ubuntu package
sudo apt-get install -y libmysql-java

path: /usr/share/java/mysql-connector-java.jar

# download
wget http://ftp.gwdg.de/pub/misc/mysql/Downloads/Connector-J/mysql-connector-java-5.1.12.tar.gz -P /tmp

# extract
tar xzf /tmp/mysql-connector-java-5.1.12.tar.gz -C /tmp/

# copy to your classpath
cp /tmp/mysql-connector-java-5.1.12/mysql-connector-java-5.1.12-bin.jar ~/NetBeansProjects/classpath/

# Netbeans
add Library / Jar File
select
~/NetBeansProjects/classpath/mysql-connector-java-5.1.12-bin.jar

# create tatabase
create database java;

LibreOffice

User Java config file in Libreoffice 4.3
/home/${USER}/.config/libreoffice/4/user/config/javasettings_Linux_X86_64.xml

Configure default paper size
echo "a4" > /etc/papersize

enable uno listener
sudo apt-get install -y patch
#wget http://www.panticz.de/sites/default/files/Setup.xcu_.diff -P /tmp/
#patch -p2 /usr/lib/openoffice/share/registry/data/org/openoffice/Setup.xcu < /tmp/Setup.xcu_.diff

add path to java
wget http://www.panticz.de/sites/default/files/javasettingsunopkginstall.xml_.diff -P /tmp/

Java

<?php
$URL="https://raw.githubusercontent.com/panticz/installit/master/install.java-jre.sh";
echo "wget $URL -O - | bash -";
echo "

";
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $URL);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
echo htmlspecialchars(curl_exec($c));
curl_close($c);
echo "

";
?>

Using the Java Persistence API in Desktop Applications
http://java.sun.com/developer/technicalArticles/J2SE/Desktop/persistenceapi/

Building a Java Desktop Database Application
http://www.netbeans.org/kb/60/java/gui-db.html

NetBeans
http://www.netbeans.org/community/releases/
http://www.netbeans.org/community/releases/roadmap.html
http://www.netbeans.org/download/flash/netbeans_6_gui_builder/netbeans_6_gui_builder.html

Database Gui
http://www.netbeans.org/kb/docs/java/gui-db-custom.html - Creating a Custom Java Desktop Database Application
http://www.netbeans.org/kb/docs/web/jsf-jpa-crud-code2.html - http://www.netbeans.org/kb/docs/web/jsf-jpa-crud-code2.html

Configure Glashfish (old)
copy c:\temp\ojdbc14.jar c:\Programme\glassfish-v2-b53\lib

Code Examples
http://exampledepot.com/

Stored procedures
http://www.ibm.com/developerworks/data/library/techarticle/dm-1209storedprocedures/
http://archive.oreilly.com/pub/a/onjava/2003/08/13/stored_procedures.html?page=2

Send Email from Java
http://www.rgagnon.com/javadetails/java-0538.html

Librarys
http://code.google.com/p/gchartjava/ - gchartjava is a free Java charts & graphs library
http://code.google.com/p/google-api-translate-java/ - simple, unofficial, Java client API for using Google Translate

PDF create with iText
http://itextpdf.com/download.php
http://sourceforge.net/projects/itext/files/latest/download - Download

Java packages in Ubuntu
sun-java6-bin - Java binaries
sun-java6-demo - demos and examples
sun-java6-doc - documentation
sun-java6-fonts - Lucida TrueType fonts from the JRE
sun-java6-jdk - metapackage for the JDK
sun-java6-jre - metapackage for the JRE
sun-java6-plugin - plug-in for Mozilla-based browsers
sun-java6-source - source files for the JDK

install original sun java 6 (/usr/lib/java-6-sun)
apt-get install sun-java6-jdk
sudo update-java-alternatives -s java-6-sun

RMI
http://www.comp.hkbu.edu.hk/~jng/comp3320/rmi.html

increase heap size (memory)
java -Xms128m -Xmx256m

# java -X
    -Xmixed           mixed mode execution (default)
    -Xint             interpreted mode execution only
    -Xbootclasspath:<directories and zip/jar files separated by :>
                      set search path for bootstrap classes and resources
    -Xbootclasspath/a:<directories and zip/jar files separated by :>
                      append to end of bootstrap class path
    -Xbootclasspath/p:<directories and zip/jar files separated by :>
                      prepend in front of bootstrap class path
    -Xdiag            show additional diagnostic messages
    -Xnoclassgc       disable class garbage collection
    -Xincgc           enable incremental garbage collection
    -Xloggc:<file>    log GC status to a file with time stamps
    -Xbatch           disable background compilation
    -Xms<size>        set initial Java heap size
    -Xmx<size>        set maximum Java heap size
    -Xss<size>        set java thread stack size
    -Xprof            output cpu profiling data
    -Xfuture          enable strictest checks, anticipating future default
    -Xrs              reduce use of OS signals by Java/VM (see documentation)
    -Xcheck:jni       perform additional checks for JNI functions
    -Xshare:off       do not attempt to use shared class data
    -Xshare:auto      use shared class data if possible (default)
    -Xshare:on        require using shared class data, otherwise fail.
    -XshowSettings    show all settings and continue
    -XshowSettings:all
                      show all settings and continue
    -XshowSettings:vm show all vm related settings and continue
    -XshowSettings:properties
                      show all property settings and continue
    -XshowSettings:locale
                      show all locale related settings and continue
 
The -X options are non-standard and subject to change without notice.
<code>
 
# set language
java -Duser.country=DE -Duser.language=de ...
 
<strong>Links</strong>
http://barcode4j.sourceforge.net/ - free barcodes generator library for Java
http://java.sun.com/j2se/javadoc/writingdoccomments/ - How to Write Doc Comments for the Javadoc Tool
http://openbook.galileocomputing.de/javainsel8/ - Java ist auch eine Insel (Galileo Computing)
http://wiki.ubuntuusers.de/Java
http://blogs.sun.com/watt/resource/jvm-options-list.html - JVM Options
http://mindprod.com/jgloss/font.html - Java Glossary