Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Lastic

macrumors 6502a
Original poster
Mar 19, 2016
879
757
North of the HellHole
Since I already have Metasploit installed built from source (which I will document later when doing a clean build from scratch) , i wanted to install the GUI called Armitage also but it needs Java 1.7 .

As such I followed this guide
https://jnorthr.wordpress.com/2012/...r-apple-ppc-imac-macbook-g3-g4-and-g5-part-2/
and adapted it to my needs

Downloaded the binary archive from
http://web.archive.org/web/20150517050519/http://www.intricatesoftware.com/OpenJDK/macppc/

cd Downloads/
sudo chmod 777 openjdk7u2-macppc-fcs-2012-03-14.tar.bz2
sudo mv openjdk7u2-macppc-fcs-2012-03-14.tar.bz2 /usr/local/
cd /usr/local/
sudo tar -xvf openjdk7u2-macppc-fcs-2012-03-14.tar.bz2
cd openjdk7u2-macppc-fcs-2012-03-14
cd bin
./java -version
./javac -version

Yippie , the binaries work !!!
Now to move them where the Apple Java version resides

cd /System/Library/Frameworks/JavaVM.framework/Versions
sudo mkdir 1.7.0
cd 1.7.0/

I opened Finder in Terminal with open . after
/usr/local/openjdk7u2-macppc-fcs-2012-03-14

and did the same for
/System/Library/Frameworks/JavaVM.framework/Versions/1.7.0

and moved everything from /usr/local/openjdk7u2-macppc-fcs-2012 to /System/Library/Frameworks/JavaVM.framework/Versions/1.7.0

cd /System/Library/Frameworks/JavaVM.framework/Versions/1.7.0
sudo chown -R root:wheel .

echo $PATH
cd ~
cat .bash_profile
cat .profile
cat .bash_rc

nano .bash_profile

I only had a .bash_profile created by Macports to which I added at the bottom
export PATH="/usr/java7:$PATH"

Closed Terminal and reopened it

echo $PATH

Now shows /usr/java7 in the beginning of the PATH variable

cd /usr/
sudo mkdir java7
cd java7

sudo ln -s /System/Library/Frameworks/JavaVM.framework/Versions/1.7.0/bin/java java
sudo ln -s /System/Library/Frameworks/JavaVM.framework/Versions/1.7.0/bin/javac javac
sudo ln -s /System/Library/Frameworks/JavaVM.framework/Versions/1.7.0/bin/javadoc javadoc
sudo ln -s /System/Library/Frameworks/JavaVM.framework/Versions/1.7.0/bin/javah javah
sudo ln -s /System/Library/Frameworks/JavaVM.framework/Versions/1.7.0/bin/javap javap
sudo ln -s /System/Library/Frameworks/JavaVM.framework/Versions/1.7.0/bin/javaws javaws
sudo ln -s /System/Library/Frameworks/JavaVM.framework/Versions/1.7.0/bin/jconsole jconsole
sudo ln -s /System/Library/Frameworks/JavaVM.framework/Versions/1.7.0/bin/jdb jdb
sudo ln -s /System/Library/Frameworks/JavaVM.framework/Versions/1.7.0/bin/jhat jhat
sudo ln -s /System/Library/Frameworks/JavaVM.framework/Versions/1.7.0/bin/jinfo jinfo
sudo ln -s /System/Library/Frameworks/JavaVM.framework/Versions/1.7.0/bin/jmap jmap
sudo ln -s /System/Library/Frameworks/JavaVM.framework/Versions/1.7.0/bin/jps jps
sudo ln -s /System/Library/Frameworks/JavaVM.framework/Versions/1.7.0/bin/jstack jstack
sudo ln -s /System/Library/Frameworks/JavaVM.framework/Versions/1.7.0/bin/jstat jstat
sudo ln -s /System/Library/Frameworks/JavaVM.framework/Versions/1.7.0/bin/jstatd jstatd
sudo ln -s /System/Library/Frameworks/JavaVM.framework/Versions/1.7.0/bin/keytool keytool
sudo ln -s /System/Library/Frameworks/JavaVM.framework/Versions/1.7.0/bin/jar jar
sudo ln -s /System/Library/Frameworks/JavaVM.framework/Versions/1.7.0/bin/jarsigner jarsigner
sudo ln -s /System/Library/Frameworks/JavaVM.framework/Versions/1.7.0/bin/extcheck extcheck
sudo ln -s /System/Library/Frameworks/JavaVM.framework/Versions/1.7.0/bin/apt apt
sudo ln -s /System/Library/Frameworks/JavaVM.framework/Versions/1.7.0/bin/appletviewer appletviewer
sudo ln -s /System/Library/Frameworks/JavaVM.framework/Versions/1.7.0/bin/idlj idlj
sudo ln -s /System/Library/Frameworks/JavaVM.framework/Versions/1.7.0/bin/orbd orbd
sudo ln -s /System/Library/Frameworks/JavaVM.framework/Versions/1.7.0/bin/pack200 pack200
sudo ln -s /System/Library/Frameworks/JavaVM.framework/Versions/1.7.0/bin/policytool policytool
sudo ln -s /System/Library/Frameworks/JavaVM.framework/Versions/1.7.0/bin/unpack200 unpack200
sudo ln -s /System/Library/Frameworks/JavaVM.framework/Versions/1.7.0/bin/tnameserv tnameserv
sudo ln -s /System/Library/Frameworks/JavaVM.framework/Versions/1.7.0/bin/serialver serialver
sudo ln -s /System/Library/Frameworks/JavaVM.framework/Versions/1.7.0/bin/servertool servertool
sudo ln -s /System/Library/Frameworks/JavaVM.framework/Versions/1.7.0/bin/rmiregistry rmiregistry
sudo ln -s /System/Library/Frameworks/JavaVM.framework/Versions/1.7.0/bin/rmic rmic
sudo ln -s /System/Library/Frameworks/JavaVM.framework/Versions/1.7.0/bin/rmid rmid
sudo chmod 777 *
cd ~
java -version

And tadaah OpenJDK 1.7
 
Last edited:
Unfortunately this doesn't help with my Armitage install since it crashes with :

Exception in thread "main" java.awt.HeadlessException
at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:202)
at java.awt.Window.<init>(Window.java:534)
at java.awt.Frame.<init>(Frame.java:420)
at javax.swing.JFrame.<init>(JFrame.java:224)
at ui.MultiFrame.<init>(MultiFrame.java:213)
at armitage.ArmitageMain.main(ArmitageMain.java:200)

Should I conclude that my openjdk install is headless ? Is there a way to check this ?
I don't know Java so if anybody could give me pointers.
 
I am pretty certain that the installation is headless as the full one would require the native UI bindings. Might be worth trying java -Djava.awt.headless=false to confirm? Just guessing!
 
  • Like
Reactions: Lastic
I am pretty certain that the installation is headless as the full one would require the native UI bindings. Might be worth trying java -Djava.awt.headless=false to confirm? Just guessing!

Thanks for your reply, my Java knowledge is non-existent so I tried your hint and it works.

java -Djava.awt.headless=false -jar /usr/local/share/armitage/armitage.jar

First had to start Metasploit since Armitage is a GUI Java App for it.

Metasploit OSX 10.5.png

And altough it's slow on a PB G4 here is the Java 1.7 app running , Armitage

Armitage OSX 10.5.png
 
  • Like
Reactions: G4fanboy
Anything that runs from a jar file and needs Java 1.7 ?

Until it works with Pyware version 7 (and it won't--I've tried) it just won't be for me. :( Programs like that make a highly specific system call to the Mac Runtime for Java that Apple used to supply. Literally, the final Apple Java is all I should need to get it running, yet it doesn't exist for PPC.
 
Sorry to bump a 2-year-old thread, but has anyone attempted installing this latest version of PPC OpenJDK 7 (2012-03-14) on Tiger, as well?
 
Ok, so before trying putting OpenJDK 7 on Tiger, I did so on Leopard. Indeed, following the steps from the first post allowed me to get OpenJDK 7 installed and to be reported with "java -version" on the Terminal...

For that, I say many thanks!

But, just like following these steps for JavaSE 6 dp6 on Leopard, it doesn't work for many apps, if not most apps. "Doesn't work", as in, they cannot detect that said version is installed, and still think you have 1.5 as latest. Trying to run those programs with something like "java -Djava.awt.headless=false -jar <full app path here.jar>" doesn't bypass the issue.

Namely, I'm trying to run JDownloader 2 intended for 10.6 and earlier, as well as the official .jar version, both supplied by the official website, and Universal versions of the Arduino IDE from the 1.5.x range (including betas). Neither can detect that something above Java 1.5 is being used, despite what "java -version" reports.

Both of those two versions of JDownloader 2 (.app and .jar) work on Tiger with the "proper" installer for JavaSE 6 dp6, in part because with this method, "Java Preferences.app" recognizes and sees that Java installation. But on Leopard, neither that nor OpenJDK 7 get that level of detection, as if there's more yet to be done to fully install things (editing some .plists, maybe? Or maybe it's more complicated than just that).

(As for the Arduino IDE 1.5.x, that won't work on Tiger, either, but instead of getting a Java-related error, like I do under Leopard, it just doesn't open the file, because the Universal app wasn't compiled in a way that makes it Tiger-compatible.)

In short, are there known ways to get OpenJDK 7, or even JavaSE 6 dp6 to be detected and listed under "Java Preferences.app"? It may be a good starting point.
 
So, a new, centralized thread for Java discussion on Tiger & Leopard was created in the Garden, and one thing popped up, which also answers one of my questions here:
Sorry to bump a 2-year-old thread, but has anyone attempted installing this latest version of PPC OpenJDK 7 (2012-03-14) on Tiger, as well?

I couldn't get Tiger to recognize OpenJDK 7 at all, this time not even with the "java -version" command. I tried all 12 different OpenJDK 7 builds that I could find (all from the Garden, which also includes the one from this thread), but none of them worked.

Did anyone ever get OpenJDK 7 to work in a Tiger installation?
 
And since I really would like to install Eclipse 4.12 (which needs Java 8) I thought why not give it a try

These were the instructions to build Java 7

And the official instructions to build Java 8


Since the Java download was temporary unavailable, I found this one that includes all the repositories


So ran bash ./configure and looks like it succesfully created a Makefile.

And now I have to wait patiently for make LOG=debug to finish , hopefully without errors.
 
Further observations on OpenJDK 1.8 :

it needs the default gmake 3.8.1 (Macports had installed 4.2.x)
it needs the NON Apple default xattr to support -c option (newer one installed via Macports)

I have to modify the spec.gmk file created by configure to

disable building hotspot (which kept giving errors and honestly why do I need it)
disable machos_universal or it will start building Intel binaries and stop with an BAD CPU error during make

Currently it's running again after upgrading xattr ...

Has anybody else tried building this from source on Leopard ?
On PPC Linux can it be installed via package managers (apt/port/yum)
 
So far it has been building everything up to jdk/lib where it then gives an error 2 on make with no further details.

The previous run also got to building everything up to jdk and gave the same make error 2 with no further details.

I have a feeling it's failing because of lack of resources, from what I can tell it's running 4 parallel java compilations during make, might try a 32 bit build on the G5 to check if the extra G5 oomph might aid.

But still I'm suprised that it's possible to compile it with little tweaks, nobody has tried this before ?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.