Skip to main content

Primary links

  • Home
  • AI
  • Kubernetes
  • Incus
  • Ansible
  • Terraform
  • OpenStack
  • Virtualization
  • Linux
  • SmartHome
  • HowTo

Misc

  • Linux
  • Hardware
  • Programming
  • Databases
  • Multimedia
  • Windows

Cloud

  • OpenStack
  • cloud-config
  • nextcloud

Virtualization

  • Virtualization
  • Incus
  • Docker
  • KVM
  • Kubernetes
  • LXC
  • LXD
  • QEMU
  • VMware
  • VirtualBox
  • multipass
  • podman
  • vagrant
  • XEN

Network

  • DNS
  • Firewall
  • Linux
  • OpenvSwitch
  • SSL
  • VLAN
  • VPN
  • iPXE
  • namespaces
  • nmcli
  • tcpdump

Storage

  • CEPH
  • DRBD
  • LVM
  • S3
  • ZFS
  • btrfs

Automation / CI/CD

  • Install
  • Ansible
  • GitLab
  • LLM
  • Preseed
  • Puppet
  • Terraform
  • Ubuntu autoinstall

Monitoring / Visualisation

  • Grafana
  • Icinga
  • Prometheus
  • Monitoring
  • ELK
  • mermaid

Jenkins: install and configure JDK

# download and extract JDK
URL=http://download.oracle.com/otn-pub/java/jdk/8u25-b17/jdk-8u25-linux-x64.tar.gz
wget --continue --no-check-certificate --header "Cookie: oraclelicense=a" ${URL} -O /tmp/${URL##*/}
tar -C /var/lib/jenkins/tools/hudson.model.JDK/ -xzf /tmp/jdk-8u25-linux-x64.tar.gz
# configure JDK

http://192.168.1.111:8080/configure
JDK
JDK installations
Add JDK
Install automatically: check out
JAVA_HOME: /var/lib/jenkins/tools/hudson.model.JDK/jdk1.8.0_25
Save

# create New Item

Item name: JDBCTest
check "Freestyle project"
JDK: JDK8
Build > Execute shell > Command
javac JDBCTest.java && java JDBCTest
Save

Build Now

Upload / Create file on Jenkins machine:

# /var/lib/jenkins/jobs/JDBCTest/workspace/JDBCTest.java

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class JDBCTest {
public static void main(String[] args) {
String HOST = "db_host";
String DB = "db_name";
String USER = "user_name";
String PASSWORD = "user_pass";

System.out.println("java.version:" + System.getProperty("java.version"));
System.out.println("java.class.path:" + System.getProperty("java.class.path"));

Connection con = null;
Statement stmt = null;
ResultSet rs = null;

try{
Class.forName("com.mysql.jdbc.Driver");
con = DriverManager.getConnection("jdbc:mysql://" + HOST + ":3306/" + DB, USER, PASSWORD);
stmt = con.createStatement();
rs = stmt.executeQuery("SELECT table_name FROM INFORMATION_SCHEMA.TABLES");

while (rs.next()) {

System.out.println(rs.getString(1));
}
}catch(SQLException e){
e.printStackTrace();
}catch(ClassNotFoundException e){
e.printStackTrace();
}finally{
try{rs.close();}catch(Exception e){}
try{stmt.close();}catch(Exception e){}
try{con.close();}catch(Exception e){}
}
}
}

Tomcat configuration

<?php
$URL="https://raw.githubusercontent.com/panticz/installit/master/install.tomcat.sh";

echo "wget $URL -O - | bash -";
echo "<div><pre>";
</pre></div>

$c = curl_init();
curl_setopt($c, CURLOPT_URL, $URL);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);

echo htmlspecialchars(curl_exec($c));

curl_close($c);

echo "";

?>

# start
export JAVA_HOME=/usr/lib/jvm/jdk1.6.0
export JAVA_OPTS="$JAVA_OPTS -Xmx256m"

/usr/local/apache-tomcat-5.5.20/bin/startup.sh

# deploy

/opt/SDK2/bin/asadmin deploy /tmp/Intranet.war

# change default port from 8080 to 80
# log directory

/var/log/tomcat6

# redirect by default to a app
mv /var/lib/tomcat6/webapps/ROOT/index.html /var/lib/tomcat6/webapps/ROOT/index.old.html
cat < /var/lib/tomcat6/webapps/ROOT/index.html

EOF

# manager

/etc/tomcat8/tomcat-users.xml
http://YOUR_TOMCAT_IP/manager/html/

# apache module

mod_jk

# LINKS

http://wiki.ubuntuusers.de/Tomcat
http://linux-sxs.org/internet_serving/c581.html
http://shrubbery.mynetgear.net/c/display/W/Disable+Directory+Listing+in+Tomcat
http://wiki.ubuntuusers.de/Tomcat

# https://intranet.sedo.de.intern/confluence/pages/viewpage.action?title=Enable+SSL+in+Tomcat&spaceKey=SOA
# https://ssl-trust.com/ssl-zertifikat-installieren/tomcat
# http://www.torsten-horn.de/techdocs/ssl.htm

Java Anwendungsentwicklung




Install Sun / Oracle Java JDK under Ubuntu

<?php
$URL="https://raw.githubusercontent.com/panticz/installit/master/install.java-jdk.sh";

echo "wget -q --no-check-certificate $URL -O - | bash -";
echo "<div><pre>";
</pre></div>

$c = curl_init();
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($c, CURLOPT_URL, $URL);

echo htmlspecialchars(curl_exec($c));

curl_close($c);

echo "";

?>

Java 10
https://www.linuxuprising.com/2018/04/install-oracle-java-10-in-ubuntu-or.html

Install JDK under Debian 7 (minimal)

echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" > /etc/apt/sources.list.d/webupd8team-java.list

apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886

echo 'Acquire::HTTP::Proxy::download.oracle.com "DIRECT";' > /etc/apt/apt.conf.d/99_oracle
apt-get update
echo "oracle-java7-installer shared/accepted-oracle-license-v1-1 select true" | debconf-set-selections
apt-get install -y oracle-java7-installer
apt-get install -y oracle-java7-set-default

Download JDK manually

# v7
URL=http://download.oracle.com/otn-pub/java/jdk/7u71-b14/jdk-7u71-linux-x64.tar.gz
# v8
URL=http://download.oracle.com/otn-pub/java/jdk/8u77-b03/jdk-8u77-linux-x64.tar.gz
# download
wget  --continue --no-check-certificate --header "Cookie: oraclelicense=a" ${URL} -O /tmp/${URL##*/}
# http://download.oracle.com/otn-pub/java/jdk/8u77-b03/jdk-8u77-linux-x64.tar.gz?AuthParam=1458983739_a16ec49d4ccc02fd689b10ad958ab0ce
# fix repo key

apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886

OPTIONAL: Uninstall OpenJDK

sudo apt-get remove -y openjdk-7-jre-headless

Display your current java version
java -version

Java: Add autocompletion to a (editable) JComboBox

1. Download this source code and add to your Java project:
http://www.orbital-computer.de/JComboBox/source/AutoCompletion.java

2. Add folowing code to enable autocompletion for your JComboBox:

AutoCompletion.enable(yourComboBox);

For further information about JComboBox and AutoCompletion see:
http://www.orbital-computer.de/JComboBox/
https://today.java.net/pub/a/today/2007/07/19/adding-auto-completion-to-swing-comboboxes.html

Install Java JRE

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

echo "wget $URL -O - | bash -";
echo "<div><pre>";
</pre></div>

$c = curl_init();
curl_setopt($c, CURLOPT_URL, $URL);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);

echo htmlspecialchars(curl_exec($c));

curl_close($c);

echo "";

?>

Download Oracle Java JRE & JDK using a script
https://ivan-site.com/2012/05/download-oracle-java-jre-jdk-using-a-script/

Fix mozilla java plugin

JAVA_HOME=/usr/lib/jvm/jdk1.7.0
MOZILLA_HOME=~/.mozilla
mkdir $MOZILLA_HOME/plugins
ln -s $JAVA_HOME/jre/lib/i386/libnpjp2.so $MOZILLA_HOME/plugins

or

ln -s $JAVA_HOME/jre/lib/amd64/libnpjp2.so $MOZILLA_HOME/plugins

or

ln -s /usr/lib/jvm/java-7-oracle/jre/lib/amd64/libnpjp2.so  ~/.mozilla/plugins/

Links
http://wiki.ubuntuusers.de/make-jpkg
https://github.com/flexiondotorg/oab-java6 - Create a local apt repository for Sun Java 6 and/or Oracle Java 7 packages.
http://www.webupd8.org/2012/01/install-oracle-java-jdk-7-in-ubuntu-via.html
http://www.webupd8.org/2011/03/install-java-in-ubuntu-1104-natty.html
http://www.sysadminslife.com/linux/howto-oracle-sun-java-7-installation-unter-debian-6-squeeze/

Install MS SQL Server JDBC Driver

# get driver

#URL=http://jaist.dl.sourceforge.net/project/jtds/jtds/1.2.5/jtds-1.2.5-dist.zip

URL=http://jaist.dl.sourceforge.net/project/jtds/jtds/1.3.1/jtds-1.3.1-dist.zip
wget ${URL} -P /tmp/
unzip /tmp/jtds-*-dist.zip -d /tmp/
sudo cp /tmp/jtds-*.jar /usr/share/java/

Eclipse > Build Path > Configure Build Path
Libraries > Add External JARs
/usr/share/java/jtds-1.2.5.jar

# fix tomcat
sudo cp /usr/share/java/jtds-1.2.5.jar /var/lib/tomcat6/webapps/builder3/WEB-INF/lib/
# Links

http://www.java-tips.org/other-api-tips/jdbc/how-to-connect-microsoft-sql-server-using-jdbc.html
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=a737000d-68d0-4531-b65d-da0f2a735707&displaylang=en
http://forums.sun.com/thread.jspa?threadID=691397
http://www.oooforum.org/forum/viewtopic.phtml?t=24036 - HowTo connect from OpenOffice / LibreOffice to MsSQL Server

Install Eclipse

<?php
$URL="https://raw.githubusercontent.com/panticz/installit/master/install.eclipse.sh";

echo "wget -q $URL -O - | bash -";
echo "<div><pre>";
</pre></div>

$c = curl_init();
curl_setopt($c, CURLOPT_URL, $URL);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);

echo htmlspecialchars(curl_exec($c));

curl_close($c);

echo "";

?>

Git plugin

# http://www.vogella.com/tutorials/EclipseGit/article.html

http://download.eclipse.org/egit/updates

WindowBuilder (Java GUI creator plugin)
http://www.eclipse.org/windowbuilder/

sudo eclipse

install new software:
http://download.eclipse.org/windowbuilder/WB/release/R201209281200/4.2/

Global settings
/usr/lib/eclipse/eclipse.ini

OPTIONAL: change editor line break to 240 char
Project > Properties
Configure Worksapece Settings
Edit
Line Wraping
Maximum line widht: 240

Links
http://www.youtube.com/watch?v=WY9QbOdWkn0 - create Java Gui Tutorial (german)
http://code.google.com/intl/de/eclipse/docs/install-eclipse-3.5.html
http://sourceforge.net/projects/shelled/

HqEclipse

You can install the plugin using the Eclipse Update Manager:

Help > Install new Software
Work with: http://hge.javaforge.com/hgeclipse
[ Add... ]
[ OK ]
check HqEclipse
[ Next > ]
[ Next > ]
check "I accept the terms of the license agreement"
[ Finish ]

confirm Security Warnings dialog with [ OK ]

Restart your Eclipse

https://j2m.googlecode.com/hg/
https://hgeclipse-demo.googlecode.com/hg/

http://code.google.com/p/hgeclipse-demo/

Create Magento SOAP account

command line

wget http://www.panticz.de/sites/default/files/soap.txt -O /tmp/soap.sql
mysql -u magento -pmagento magento < /tmp/soap.sql

Create soap role
System > Web Services > Roles
[Add New Role]
Role name: API Full Access

Roles Resources
Resource Access: All

[Save Role]

Create soap user
System > Web Services > Users
[Add New User]
User Name: soap
First Name: soap
Last Name: soap
Email: soap@soap.com
Api Key: test123
Api Key Confirmation: test123
This account is: Active

User Role
select: API Full Access

[Save User]

SOAP login test with PHP
// Magento login information
$mage_url = 'http://YOUR_MAGENTO_IP/magento/index.php/api/?wsdl';
$mage_user = 'soap';
$mage_api_key = 'test123';
// Initialize the SOAP client
$soap = new SoapClient( $mage_url );
// Login to Magento
echo $soap->login( $mage_user, $mage_api_key );
?>

$URL="http://dl.dropbox.com/u/4170695/magento/magento-product-info.php";
echo "wget $URL -O - | bash -";
echo "

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

";
?>

Pagination

  • 1
  • Next page
java
Profiles GitHub StackOverflow LinkedIn Xing
Contact Imprint
© panticz 2026

Cookie-Einstellungen

Diese Website nutzt eingebettete Inhalte von Drittanbietern (z.B. YouTube, SoundCloud). Beim Laden dieser Inhalte werden Daten an die jeweiligen Anbieter übermittelt. Datenverarbeitungserklärung