DZone
Java Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Java Zone > 32 bit JDK on a 64 bit Ubuntu System

32 bit JDK on a 64 bit Ubuntu System

Derek Young user avatar by
Derek Young
·
Sep. 09, 08 · Java Zone · Interview
Like (0)
Save
Tweet
98.89K Views

Join the DZone community and get the full member experience.

Join For Free

If you have more than 3GB on your machine and you’re running Ubuntu you’ve probably had to figure out how to access that additional memory – the default Ubuntu desktop kernel will only allow access to the first 3GB. You can install the server kernel, but that’s been tuned for a server with different latency settings, etc. You can recompile the desktop kernel with HIGHMEM64 set, but then you’re stuck building the video drivers yourself.

My latest strategy has been to use the 64 bit kernel. 64 bit support is not bad now and most apps run normally. Of course they use about double the memory. If you’re running a lot of Java processes this 64 bit tax is very noticeable. For my needs, 32 bit Java is fine, even with a 64 bit kernel. Ubuntu/Debian ship a 32 bit JRE (ia32-sun-java6-bin). This package provides only the runtime environment (no javac) and the client VM so it has limited usefulness for a developer.

To install the 32 bit JDK from Sun on a 64 bit system you can use java-package. I’ve been running Eclipse and all my development applications and finally have some free memory again.

Installation

First, download the latest 32 bit JDK (not JRE) from Sun. At the time this was jdk-6u7-linux-i586.bin for me.

Install java-package:

sudo apt-get install java-package

Now use java-package to build a .deb package from the binary you downloaded. You have to trick it into building the 32 bit package:

DEB_BUILD_GNU_TYPE=i486-linux-gnu DEB_BUILD_ARCH=i386 fakeroot make-jpkg jdk-6u7-linux-i586.bin

This should generate a .deb package. For some reason the package name has the _amd64 suffix. Install the package:

sudo dpkg -i sun-j2sdk1.6_1.6.0+update7_amd64.deb

Use update-alternatives to select the new JDK. It was installed at /usr/lib/j2sdk1.6-sun for me.

sudo update-alternatives --config java

If you run java -version you should see the correct version:

java version "1.6.0_07"
Java(TM) SE Runtime Environment (build 1.6.0_07-b06)
Java HotSpot(TM) Server VM (build 10.0-b23, mixed mode)

 

 

32 bit Eclipse

I had to reinstall the 32 bit version of Eclipse (since SWT contains native code). I also had to delete my ~/.eclipse directory or Eclipse wouldn’t start (this requires reinstalling new versions of any plugins). Finally, add the new JRE in Java->Installed JREs using the install location (/usr/lib/j2sdk1.6-sun) and select it as the default.

 

From http://dmy999.com/

 

Java (programming language) 32-bit Java Development Kit 64-bit ubuntu

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Path-Based Routing in Render With Kong API Gateway
  • 5 Tips for a Successful Threat Hunt
  • ERP Integration Guide | Common Scenarios, Challenges, and Methods
  • How I Cracked Chinese Wordle Using a Knowledge Graph

Comments

Java Partner Resources

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo