Forums > Java

java 1.5 version troubles again

February 26, 2006 | 9:34 pm

hello,
for whatever reason, i’m unable to use some of my java classes.
they are classes that need 1.5 features; i had therefore added

max.java.jvm.version 1.5

to the config file and was successfully using things. however, since then i’ve upgraded to 4.5.6 from 4.5.5 and to 10.4.5 from 10.4.4 and now i get this error:

______________________
? error: java.lang.UnsupportedClassVersionError: ali/msp/migrator (Unsupported major.minor version 49.0)
? error: at java.lang.ClassLoader.defineClass0(Native Method)
? error: at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
? error: at com.cycling74.max.MXJClassLoaderImpl.doLoadClass(MXJClassLoa derImpl.java:119)
? error: at com.cycling74.max.MXJClassLoader.loadClazz(MXJClassLoader.ja va:88)
? error: Could not load class ‘ali.msp.migrator’
______________________

i am able to compile the code, and a .class file is created. however, when i put the name of my class in an mxj, i get the above error. if i put it in an mxj quickie, then i get no error until i double click, at which time i get the error and the mxj objects starts flashing and never stops. if i delete the object and put down another mxj quickie, it’s flashing right away.

any ideas?

thanks,
a


February 26, 2006 | 10:12 pm

I’m guessing you already tried this, but it wasn’t mentioned in your
email. did you re-add the max.java.jvm.version 1.5 to the config file
after upgrading? The upgrrade might’ve changed it.

just a guess,
wes


February 26, 2006 | 10:22 pm

yes, that line is still in the config file…


February 26, 2006 | 10:33 pm

On 06-02-26, at 1812, Wesley Smith wrote:
> I’m guessing you already tried this, but it wasn’t mentioned in your
> email. did you re-add the max.java.jvm.version 1.5 to the config file
> after upgrading? The upgrrade might’ve changed it.
>
the most recent builds of java 1.5 for os10 now set it to be the
system default, instead of leaving 1.4.2 as the default. try running
java -version from a command line and see what it says. java 1.5
works in max here w/o having to fiddle with any max config files at all.

best,
r.


February 26, 2006 | 10:38 pm

On 26 Feb 2006, at 22:34, Ali Momeni wrote:

> however, since then i’ve upgraded to 4.5.6 from 4.5.5 and to 10.4.5
> from 10.4.4

Hmm. Of course, you’ll need to add the config line for each new
version of Max/MSP (probably: I always install distinct and separate
Max/MSP releases, rather than upgrade). I’ve done a series of OS X
upgrades and have not seen these java problems.

Do you get a

(mxj) attempting to to set java version to 1.5

when you start Max?

nick rothwell — composition, systems, performance — http://
http://www.cassiel.com


February 26, 2006 | 10:41 pm

On 26 Feb 2006, at 23:33, ritchie wrote:

> the most recent builds of java 1.5 for os10 now set it to be the
> system default, instead of leaving 1.4.2 as the default.

Not here it ain’t. "java -version" still reports 1.4.2_09. This is OS
X 10.4.5.

(The Java 5 I’m running is 1.5.0_05 – I think it’s Apple’s Release 3.
I love these version numbers.)

nick rothwell — composition, systems, performance — http://
http://www.cassiel.com


February 26, 2006 | 10:43 pm

i have the latest apple java release installed, i.e.

http://www.apple.com/support/downloads/java2se50release3.htm l

and still, java -versions returns

java version "1.4.2_09"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_09-232)
Java HotSpot(TM) Client VM (build 1.4.2-54, mixed mode)

on top of that, it seems that the line added to the mxj config file doesn’t change anything…

a


February 26, 2006 | 10:48 pm

On 26 Feb 2006, at 23:43, Ali Momeni wrote:

> java version "1.4.2_09"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_09-232)
> Java HotSpot(TM) Client VM (build 1.4.2-54, mixed mode)

That’s what I have.

nick rothwell — composition, systems, performance — http://
http://www.cassiel.com


February 26, 2006 | 10:48 pm

hi nick,

indeed, i do NOT get this

(mxj) attempting to to set java version to 1.5

when you i start max.

and i really do have this line

max.java.jvm.version 1.5

in the mxj config file….

?


February 26, 2006 | 10:50 pm

Ok, then you need to make java 1.5 your default. There’s a program in
Applications/Utilities/Java/J2SE 5.0 called Java Preferences. You
need to set 1.5 as the default JVM. There might be some other
settings to change as well.

wes


February 26, 2006 | 10:52 pm

note that 10.4.5 does not mean you magically get java 1.5, java 1.5
is still an ADC only thing.

also note that since you’re running beta software, it pays to stay up
to date (if you’re not an ADC member, don’t read this next paragraph
as I’m probably violating some apple nda):

February 22, 2006

Java 2 Standard Edition (J2SE) 5.0 Release 4 delivers improved
reliability and compatibility for J2SE 5.0 on Mac OS X v10.4.5 and
later. This release includes J2SE version 1.5.0_06. With this update
J2SE 5.0 becomes the preferred Java version, superseding Java 1.4.2.
Java 1.4.2 is still installed on your machine, but applications run
with J2SE 5.0 unless they specifically request Java 1.4.2.

best,
r.


February 26, 2006 | 10:56 pm

hi wes,
thanks for the help.
i’ave already used

Applications/Utilities/Java/J2SE 5.0 called Java Preferences

to set java version to 1.5

i did that months ago when i installed 1.5 for the first time, and the settings are still those…


February 26, 2006 | 10:59 pm

Ok,
Then I’ve maxed out my JAVA knowledge. I think updating to the latest
apple release this the best solution then.

wes


February 26, 2006 | 11:03 pm

On 26 Feb 2006, at 23:50, Wesley Smith wrote:

> There’s a program in
> Applications/Utilities/Java/J2SE 5.0 called Java Preferences. You
> need to set 1.5 as the default JVM.

As far as I know, this only changes the default Java system for
browsers, and is not terribly useful for anything else. I don’t know
of any other preference settings. I just modified the shell search
path in my .bashrc to get java 5 for console programs.

– N.

nick rothwell — composition, systems, performance — http://
http://www.cassiel.com


February 26, 2006 | 11:04 pm

On 06-02-26, at 1852, ritchie wrote:

> note that 10.4.5 does not mean you magically get java 1.5, java 1.5
> is still an ADC only thing.
>
whoops, my bad. I assumed that there wasn’t a public release of java
1.5 yet, but apparently there is? anyway, I would recommend signing
up for a free membership at developer.apple.com. inside, you’ll get
some preview software, including release 4 dev preview 6 of java 1.5.
release 4 dp 6 is what gives you 1.5 as the default jvm on your system.

sorry for the confusion.

r.


February 26, 2006 | 11:06 pm

> note that 10.4.5 does not mean you magically get java 1.5, java 1.5
> is still an ADC only thing.

Don’t think so – you can go straight to http://www.apple.com/java and
download it as an ordinary punter.

> Java 2 Standard Edition (J2SE) 5.0 Release 4 delivers improved
> reliability and compatibility for J2SE 5.0 on Mac OS X v10.4.5 and
> later.

Odd. Once I had Release 1 in there, Release 3 came as an automatic
system update, but this Release 4 isn’t coming down the line (yet).

nick rothwell — composition, systems, performance — http://
http://www.cassiel.com


February 26, 2006 | 11:32 pm

ok,
so i downloaded and installed

J2SE 5.0 Release 4 DP6

and that seems to have solved the problem.

however, note that for whatever reason, this line in the mxj config file

max.java.jvm.version 1.5

no longer seems to do anything.

a


February 28, 2006 | 11:28 pm

hey ali,
i tried to send you an email yesterday with a debug version of mxj that will hopefully give us more insight into what is going on.The list stopped it because the message was too big. Is it possible that you have more than one max.java.config.txt? Also it might just be working because the latest 1.5 update might have changed the links in System/Library/Frameworks/JavaVM.framework/ to point to 1.5 as the current version. I will send you the debug extern when i get home. If you have that property defined in max.java.config.txt it should definitely print something to the console. OK. Take care.
Topher


March 1, 2006 | 1:49 am

yes, of course. thanks for the hint topher, i should have looked for a second max.java.config.txt file and indeed, it appear that IRCAM’s FTM comes with it’s own max.java.config.txt (!@#$). very annoying but i should have expected it.


March 1, 2006 | 2:28 am


March 1, 2006 | 10:01 am

> Nick, could you share the magical line you put in your .bashrc to
> do it ?

It’s just an alteration to the shell’s search path, so that when I
say "java foo" in a console window I get Java 1.5:

JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versio ns/1.5/Home
PATH=$JAVA_HOME/bin:$PATH

Nothing really fancy.

> I don’t think I need to change the links in
> /System/Library/Frameworks/JavaVM.framework/
> each time I want to change the jvm.

You could modify the symlinks to make Java 1.5 the default, but that
could cause upset to a System Update run at some stage, and, for me
at least, the things which need to know about a nonstandard Java
system on the Mac are just

- console programs
- Eclipse
- Max/MSP

so it’s a path of least disturbance to deal with them individually.

nick rothwell — composition, systems, performance — http://
http://www.cassiel.com


March 1, 2006 | 10:27 am


March 1, 2006 | 3:02 pm


March 1, 2006 | 3:43 pm


March 1, 2006 | 4:39 pm

for this kind of unix tinkering, I find "Running MacOS X Tiger" from
O’Reilly
a good source. here is what I found

with the introduction of Panther (10.3) the default shell is no
longer tcsh but bash,
because of its support for unicode.

to change the shell, there is more than one way.

open Terminal > Preferences
enter /bin/ksh or whatever you prefer
there is sh ksh csh tcsh zsh bash in your /bin

this does not change the shell when you log in remotely.
to change that too, use netinfo.

chsh -s changes the netinfo database as well.

HtH
-jennek


March 1, 2006 | 4:48 pm

Fair enough. My TiBook has been through a series of incremental
upgrades from 10.1 upwards, and my shell was still tcsh, but on my new-build Sawtooth it is indeed bash, as it is on my Mac mini (10.3->10.4). Terrific.

nick rothwell — composition, systems, performance — http://
http://www.cassiel.com


Viewing 26 posts - 1 through 26 (of 26 total)