Jump to content

Java SDK 1.5 (5.0)


Archalien
 Share

18 posts in this topic

Recommended Posts

Hey guys

 

I have OSX running nicely w/ SSE2 -> SSE3 patch

Rosetta works fine, I can run and install nething I want cept-

 

I can compile simple java code in Bluej using 1.4

Installed 1.5 but cant compile simple 1.5 code

 

Mac documentation says to enable 1.5 as default-- run:

 

/Applications/Utilities/Java/J2SE 5.0/Java Prefrences

 

but it crashes b4 launch with this in console:

 

[JavaAppLauncher Error] CallStaticVoidMethod() threw an exception

Exception in thread "main" java.lang.UnsupportedClassVersionError: com/sun/deploy/panel/ControlPanel (Unsupported major.minor version 49.0)

at java.lang.ClassLoader.defineClass0(Native Method)

at java.lang.ClassLoader.defineClass(ClassLoader.java:539)

at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)

at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)

at java.net.URLClassLoader.access$100(URLClassLoader.java:55)

at java.net.URLClassLoader$1.run(URLClassLoader.java:194)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:187)

at java.lang.ClassLoader.loadClass(ClassLoader.java:289)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)

at java.lang.ClassLoader.loadClass(ClassLoader.java:235)

at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:219)

at apple.launcher.LaunchRunner.loadMainMethod(LaunchRunner.java:55)

at apple.launcher.LaunchRunner.run(LaunchRunner.java:84)

at apple.launcher.LaunchRunner.callMain(LaunchRunner.java:50)

at apple.launcher.JavaApplicationLauncher.launch(JavaApplicationLauncher.java:52)

 

 

ne ideas???

Link to comment
Share on other sites

I bet Control Panel is written in 1.5 (49.0) and is trying to be run in a 1.4 (48.0) VM.

 

Any reason you require 1.5? Are you using generics, annotations etc?

I will have a look this weekend is I would like to run 1.5 but I'll be happy if 1.4 runs perfectly.

 

PS: How well are you finding OSX on your Sentia? ;)

Link to comment
Share on other sites

Good point on 1.4 VM, Ill check that

*Update, doh dl'd 1.5 VM not SDK, cant find SDK though???

I do alot of Java programming right now and require 1.5

 

As of now tri-boot Windows XP Pro,OSX, Fedora 4 Linux is flawless!!!

 

Only 3 things I cant do in OSX:

Java 1.5

DVD no hardware accel for gfx

No wireless nic

 

Other than that u couldnt tell its not on a powerbook...so far

Link to comment
Share on other sites

It may be as simple as a single hex edit of a file to set 1.5 as default but determinig what to edit is beyond my skill.

 

If I knew for sure what file stores this prefrence I might be able to copy it off a working mac w/ 1.5 enabled and replace the one on my x86 install.

 

This is where a little help would be appreciated.

Link to comment
Share on other sites

Well, I installed Java 5 and had to manually change OSX to use 1.5 instead of 1.4 however, 1.5 doesnt run too good.

 

If you want to try you have to change a symbolic link named CurrentJDK to point from 1.4.2 to your newly installed 1.5

 

I cant remember the directory atm but all the JDKs are installed in their in a directory called Versions (check out where /usr/bin/java points to for a clue).

 

Hope this helps. I'm going to do a full dvd install using release1 and maybe 0.5 patch and try again. Maybe going to use VMWare for this so I dont blast my current install...

Link to comment
Share on other sites

Good work!! well almost

Did some lurnin and changed the link as you suggested.

now console inqueries jor java and javac show version 1.5.0_02

 

was able to compile simple hello program that tested 1.5 compatibility from the terminal with no problem.

 

but still wont work with bluej??????

If I can get bluej to compile 1.5 code Id have no more need for linux.

Link to comment
Share on other sites

The bundled 1.4.2_07 is an x86 compiled JVM. It will JIT to x86 code as well. When you download 1.5 (j2se 5.0), it will be ppc, which will most likely JIT to ppc code. As a result, it will most likely not work.

If rosetta were perfectly stable, then the 1.5 JVM may run, but will run extremely slow. The path it will take is Java byte code -> JIT to ppc -> execute via rosetta -> dynarec to x86.

 

 

Very few apps out there require JDK 1.5. IMHO, I would save the head aches and stick with the bundled 1.4.2 JVM. It seems to be mostly stable.

Link to comment
Share on other sites

The bundled 1.4.2_07 is an x86 compiled JVM.  It will JIT to x86 code as well.  When you download 1.5 (j2se 5.0), it will be ppc, which will most likely JIT to ppc code.  As a result, it will most likely not work.

If rosetta were perfectly stable, then the 1.5 JVM may run, but will run extremely slow.    The path it will take is  Java byte code -> JIT to ppc -> execute via rosetta -> dynarec to x86.

Very few apps out there require JDK 1.5.  IMHO, I would save the head aches and stick with the bundled 1.4.2 JVM.  It seems to be mostly stable.

 

I have no clue what you just said, but I dont want to run Java 5.0 programs, I HAVE TO write Java 5.0 programs.

 

After changing the symbolic link to the 5.0 directory, Ive been able to get a simple "Hello" program (w/ some arbitrary 5.0 code inside) to compile from the command line every so often with occasional failures due to a bus error(??). But bluej still looks for 1.4, so I manually modified its config file to direct it to the correct java/javac files and the default version to 1.5 but it hangs if I take out the default version info then it uses 1.5 to compile but complains about the 5.0 code cuz bluej is requesting to compile in 1.4???

 

So this may be more of a bluej problem??

Neone else compile 5.0 in an IDE?

Link to comment
Share on other sites

I have no clue what you just said, but I dont want to run Java 5.0 programs, I HAVE TO write Java 5.0 programs.

 

After changing the symbolic link to the 5.0 directory, Ive been able to get a simple "Hello" program (w/ some arbitrary 5.0 code inside) to compile from the command line every so often with occasional failures due to a bus error(??). But bluej still looks for 1.4, so I manually modified its config file to direct it to the correct java/javac files and the default version to 1.5 but it hangs if I take out the default version info then it uses 1.5 to compile but complains about the 5.0 code cuz bluej is requesting to compile in 1.4???

 

So this may be more of a bluej problem??

Neone else compile 5.0 in an IDE?

 

 

I'm a bit confused as well by your response. Why do you need to write a Java 5.0-only compliant Java app? Isn't it to your advantage to write something that works on 1.3, 1.4, 1.5? Are you needing to use generics templates, or you just have to use abbreviated for loops like for (i : x){}? J2SE 5.0 certainly adds lots of neat stuff, but I don't believe any of it is essential.

 

On the bluej page, it says the environment runs on either 1.4.2 or 1.5.

 

You can also try using jikes. I compiled it natively for MacOS X x86, and it works okay.

I don't know if it supports 1.5 syntax though.

 

You may want to do some research on JIT, Java, and dynamic recompilation. It will probably become more apparent as to why you would not want to run a PPC compiled PPC machine code generating JVM vs. a x86 compiled x86 machine code generating JVM.

Link to comment
Share on other sites

I'm a bit confused as well by your response.  Why do you need to write a Java 5.0-only compliant Java app?  Isn't it to your advantage to write something that works on 1.3, 1.4, 1.5?  Are you needing to use generics templates, or you just have to use abbreviated for loops like for (i : x){}?  J2SE 5.0 certainly adds lots of neat stuff, but I don't believe any of it is essential. 

 

On the bluej page, it says the environment runs on either 1.4.2 or 1.5.

 

You can also try using jikes.  I compiled it natively for MacOS X x86, and it works okay.

I don't know if it supports 1.5 syntax though.

 

You may want to do some research on JIT, Java, and dynamic recompilation.  It will probably become more apparent as to why you would not want to run a PPC compiled PPC machine code generating JVM vs. a x86 compiled x86 machine code generating JVM.

 

Sorry if u missed it, I write java 5.0 software, this isnt a matter of choice, its what Im required to do. I do it in windows and linux, I do so much of it that I would like to do it on OSX86 for kicks and giggles. I dont know what your talking about with the JVM, I could care less about the VM, It doesnt matter what system I compile on (Write once, run(Debug) everywhere).

Link to comment
Share on other sites

 Share

×
×
  • Create New...