Posts Tagged ‘JRE’

How to resolve network issues with Java 6 JRE on Debian / Java proxy spawn on Debian sid not working by default – A Small tip on running WebScarab and Paros local Proxy on Debian’s Java

Wednesday, April 28th, 2010

In an attempt to use Paros Proxy and WebScarab on Debian I faced a shitty issues with Java’s Networking.

Neither of the forementioned Security Applications’s Local Proxy to be spawned by the Java server won’t work.

I assured my self there is nothing running on the ports 8080 on which the two Java applications attempted to run their local proxy server.
Being sure that nothing is listening on the 8080 port. I suspected that there is something wrong with Debian’s Java networking.
A quick search in Google pointed me to the Debian.Net’s forums where the issue was described as serious proxy error after updates .

The error that was returned by the ParosProxy Server on my Desktop Debian can be reviewed below:

hipo@noah:~/paros$ /usr/lib/jvm/java-6-sun-1.6.0.17/jre/bin/java -jar paros.jar
file:/home/hipo/paros/paros.jar
file:/home/hipo/paros/paros.jar
java.net.SocketException: Invalid argument
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:365)
at java.net.ServerSocket.bind(ServerSocket.java:319)
at java.net.ServerSocket.<init>(ServerSocket.java:185)
at org.parosproxy.paros.core.proxy.ProxyServer.createServerSocket(Unknown Source)
at org.parosproxy.paros.core.proxy.ProxyServer.startServer(Unknown Source)
at org.parosproxy.paros.control.Proxy.startServer(Unknown Source)
at org.parosproxy.paros.control.Control.init(Unknown Source)
at org.parosproxy.paros.control.Control.<init>(Unknown Source)
at org.parosproxy.paros.control.Control.initSingletonWithView(Unknown Source)
at org.parosproxy.paros.Paros.runGUI(Unknown Source)
at org.parosproxy.paros.Paros.run(Unknown Source)
at org.parosproxy.paros.Paros.main(Unknown Source)

All a man can grasp from the Error is that there is something wrong with running the Paros Proxy server.
So far so good since the last release of Paros Proxy originates back to the year 2006 and it’s not really supported this days at first I thought this could be causing the error.
By the way the paros proxy is available via the debian packaging system. So I use the packaged version of paros to install the Debian packaged version of Paros Proxy issue the cmd:

root@noah:~# apt-get install paros

In that manner of thoughts I decided to try out the newer more modern HTTP and HTTPS Security Analysing Application WebScarab

I followed the start up instructions on WebScarab’s Website in order to run the application.
It was really simple. All I had to do is download the webscarab-current.zip which of the time of writting this post is webscarab-20100414-0036 and then launch the Java Debian Virtual machine.

However though my hopes that WebScarab’s local Proxy server will be running fine I was unpleasently suprised by the error which shown below:

hipo@noah:~/webscarab-20100414-0036$ java -jar webscarab.jar
Help set not found
11:43:36 main(Proxy.parseListenerConfig): No proxies configured!?
11:43:39 Proxy(Proxy.run): Unable to start listener 127.0.0.1:8008

Ain’t pretty heh?! … Even nasty !

However I was lucky to find the solution in some 20 minutes, so hopefully it took you less to find this post.

The solution to the above Proxy Spawn Error with Paros and Webscarab on Debian Lenny’s Java 6 Sun Server is really simple and it comes to this:

1. edit /etc/sysctl.d/bindv6only.conf and change the value

net.ipv6.bindv6only = 1
# to
net.ipv6.bindv6only = 0

2. Restart procps

root@noah:/home/hipo/webscarab-20100414-0036# invoke-rc.d procps restart

Now launch once again either Paros Proxy or Webscarab, the Local Proxy Server by each of them will bind to either port 8008 (WebScarab) or port 8008 (Paros Proxy).

How to install Java Virtual Machine on Debian 7 GNU / Linux

Wednesday, July 23rd, 2014

install-java-on-debian-gnu-linux-logo
Debian 7 stable as most stable Debian releases includes custom Open Source Oracle Java Virtual Machine version called IcedTea OpenJDK, just like with sun's proprietary java, open sourced icedtea fork is made of two components:
 

JREJava Runtime Environment

and

 

JDKJava Development Kit).


1. installing OpenJDK Open Source Java Virtual Machine on Debian GNU / Linux

openjdk_java_open_source_virtual_machine_linux-logo
The default meta-package for install java-jre is default-jre meta package which by default on Debian Wheezy points to openjdk:

 

 

apt-cache depends default-jdk
default-jdk
  Depends: default-jre
  Depends: openjdk-6-jdk

If you want to install default Open Source Java Debian package implementation run:
 

apt-get –yes install default-jre

apt-get –yes install default-jdk


2. Installing Oracle Java VM 7 on Debian / Ubuntu Linux and deb derivatives
/images/oracle_java_logo-linux-install-debian
Also it is possible to install Oracle Java 7 from binary via apt-get by adding a custom Ubuntu repository containing deb Oracle proprietary java install package called oracle-java7-installer:
 

echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee -a /etc/apt/sources.list
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee -a /etc/apt/sources.list
apt-key adv –keyserver hkp://keyserver.ubuntu.com:80 –recv-keys EEA14886
apt-get update
apt-get install –yes oracle-java7-installer


 Above apt-get command can be used also to install Oracle Sun Java on Ubuntu Linux and other Debian derivatives, for example you can install it like this on Linux Mint and rest of deb based Desktop oriented Linuces …

installing-java-debian-7-linux-install-oracle-java-7-screenshot-1

installing-java-debian-7-linux-install-oracle-java-7-screenshot-2

If you already have the openjdk installed together with oracle java jdk, to make oracle jdk the default Virtual Machine install also oracle-java7-set-default:

apt-get install oracle-java7-set-default


3. Installing Oracle Java 8 the debian way on Debian and Ubuntu Linux

echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee /etc/apt/sources.list.d/webupd8team-java.list
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee -a /etc/apt/sources.list.d/webupd8team-java.list
apt-key adv –keyserver keyserver.ubuntu.com –recv-keys EEA14886
apt-get update
apt-get install oracle-java8-installer


4. Install Oracle Proprietary Java on Debian Linux using any version from Oracle website

As some written software requires custom ex-SUN Microsystems and currently owned by Oracle Java proprietary non-free binaries to install them on Debian Linux 7, there is a way to download any sun java jdk version, create .deb package and install the package with dpkg.

Here is how:

a.) Install java-package meta-package

apt-get –yes install java-package

 

Building dependency tree       
Reading state information… Done
The following extra packages will be installed:
  autopoint debhelper gettext git git-man html2text intltool-debian liberror-perl libgettextpo0 libmail-sendmail-perl libsys-hostname-long-perl po-debconf rsync
Suggested packages:
  dh-make gettext-doc git-daemon-run git-daemon-sysvinit git-doc git-el git-arch git-cvs git-svn git-email git-gui gitk gitweb libmail-box-perl
The following NEW packages will be installed:
  autopoint debhelper gettext git git-man html2text intltool-debian java-package liberror-perl libgettextpo0 libmail-sendmail-perl libsys-hostname-long-perl po-debconf rsync
0 upgraded, 14 newly installed, 0 to remove and 112 not upgraded.
Need to get 11.8 MB of archives.
After this operation, 24.7 MB of additional disk space will be used.

b.) Download your desiresd Oracle Java version


Then according to your Debian Linux platform install (32-bit x86 or 64-bit amd64) go in a browser to:

http://www.oracle.com/technetwork/java/javase/downloads/index.html

Accept the agreement and download latest Java release, if you need to install some specific Oracle Java version check out there Old Java download versions (archives) page

Note that in order to download, either you will need some text-browser like elinks or you will need to have a GUI environment with IceWeasel / Epiphany etc. If you're already using the Linux as a desktop environment with GNOME and you used IceWeasel to download java jdk it will be downloaded into /tmp

cd /tmp
make-jpkg <downloaded_jdk_file>

Install the binary package created:

dpkg -i oracle-j2sdk1.7_1.7.0+update44_amd64.deb

Enjoy 🙂