Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Javaws error "Unable to locate a Java Runtime to invoke"

No Java runtime present, requesting install.

Unable to locate a Java Runtime to invoke.


If i do java -version:

java -version

java version "1.6.0_33"

Java(TM) SE Runtime Environment (build 1.6.0_33-b03-424-10M3720)

Java HotSpot(TM) 64-Bit Server VM (build 20.8-b03-424, mixed mode)


I already try:


-Delete cache and temp file (library/cache)

- I delete old and new installation of java folders inside: /System/Library/Frameworks/JavaVM.framework/Versions


- I delte folder: /System/Library/Java

- Already download manually the Java from Apple site, reinstall 2 times and reboot... not solved.


ANy idea?

MacBook Air, Mac OS X (10.6.8)

Posted on Jun 18, 2012 3:50 AM

Reply
Question marked as Best reply

Posted on Jun 18, 2012 5:24 AM

Make sure the Java you have installed is not subject to the problems of Flashback.

8 replies

Jun 18, 2012 6:06 AM in response to a brody

I download it from Apple too, same file.


I found a good site may be help me: http://osdir.com/ml/java-dev/2010-10/msg00974.html

Problem could be path problem of javaws


TigreDARK:Home XXXXXXX$ /usr/libexec/java_home

/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home

TigreDARK:Home XXXXXX$ cd /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home

TigreDARK:Home XXXXXX$ pwd

/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home

TigreDARK:Home XXXXX$ ls

bin bundle include lib man

TigreDARK:Home XXXXXX$ cd bin

TigreDARK:bin XXXXXX$ ls

appletviewer javadoc jmap native2ascii serialver

apt javah jps orbd servertool

extcheck javap jrunscript pack200 tnameserv

idlj javaws jsadebugd policytool unpack200

jar jconsole jstack rmic wsgen

jarsigner jdb jstat rmid wsimport

java jhat jstatd rmiregistry xjc

javac jinfo keytool schemagen

TigreDARK:bin XXXXX$ javaws

No Java runtime present, requesting install.

Unable to locate a Java Runtime to invoke.

TigreDARK:bin XXXXXXX$ ./javaws

Java Web Start splash screen process exiting ...

Can not find message file: No such file or directory

TigreDARK:bin XXXXXXX$ ./javaws /Users/myuser/Desktop/login.jsp

TigreDARK:bin XXXXXXXX$ Error occurred during initialization of VM

java/lang/ClassNotFoundException: error in opening JAR file <Permission denied> /System/Library/Java/Support/Deploy.bundle/Contents/Home/lib/deploy.jar


====================================================

TigreDARK:lib XXXXXX$ ls -l

total 24

drwxr-xr-x 5 root wheel 170 5 jun 19:30 deploy

lrwxr-xr-x 1 root wheel 31 18 jun 12:54 deploy.jar -> ../../Resources/Java/deploy.jar

lrwxr-xr-x 1 root wheel 31 18 jun 12:54 javaws.jar -> ../../Resources/Java/javaws.jar

lrwxr-xr-x 1 root wheel 31 18 jun 12:54 plugin.jar -> ../../Resources/Java/plugin.jar

drwxr-xr-x 6 root wheel 204 18 jun 12:54 security

======================================================


-bash: java_home: command not found

TigreDARK:libexec xxxxxxx$ ls -la java_home

lrwxr-xr-x 1 root wheel 79 18 jun 12:54 java_home -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java_home

TigreDARK:libexec xxxxxx$ ./java_home --verbose

Matching Java Virtual Machines (2):

1.6.0_33-b03-424, x86_64: "Java SE 6" /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home

1.6.0_33-b03-424, i386: "Java SE 6" /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home


/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home

======================================================


I already lunch the disk utility to fix permissions problem on the files.... from utility say it solve, but is not true...

So i think I have 2 problems...

1) correct path of javaws

2) Permissions problem with Java files.

Jun 18, 2012 7:24 AM in response to Mark Jalbert

I partialy solve problem...


I add manually (from finder) user permissions to this folders/files:

I now need to lunch like this:

cd /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin

./javaws /Users/myuser/Desktop/login.jsp


Now it open but give me some error on my personal application.... may be something is not correct.... but I think I'm in the correct way....


how i fix the problem:

/System/Library/Java/Support/Deploy.bundle/Contents/Resources/Java

files i add permissions of my user, and write read:

deploy.jar

javaws.jar


/System/Library/Java/Support/Deploy.bundle/Contents/Home/Lib

I add here too a R+W permission to "system" and to my user r+w




===========================================


In any case:


TigreDARK:bin myuser$ /usr/libexec/PlistBuddy -c "Print" $HOME/Library/Preferences/ByHost/com.apple.java.JavaPreferences.*

Dict {

GeneralByTask = Dict {

Any = Dict {

PrefsVersion = 2

}

}

}


==========================================


I try to lunch now with short path (only put javaws from command line)


javaws

No Java runtime present, requesting install.

Unable to locate a Java Runtime to invoke.

Jun 18, 2012 7:38 AM in response to TigreDARK

Here the verbose mode when I lunch javaws with "working" path:


TigreDARK:bin Myuser$ ./javaws -verbose /Users/Myuser/Desktop/login.jsp

Java Web Start: Launching: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java

/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java

-d64

-Xbootclasspath/a:/System/Library/Java/Support/Deploy.bundle/Contents/Home/lib/ javaws.jar:/System/Library/Java/Support/Deploy.bundle/Contents/Home/lib/deploy.j ar:/System/Library/Java/Support/Deploy.bundle/Contents/Home/lib/plugin.jar

-classpath

/System/Library/Java/Support/Deploy.bundle/Contents/Home/lib/deploy.jar

-Djava.security.policy=file:/System/Library/Java/Support/Deploy.bundle/Contents /Home/lib/security/javaws.policy

-DtrustProxy=true

-Xverify:remote

-Djnlpx.home=/System/Library/Java/Support/Deploy.bundle/Contents/Home/bin

-Dsun.awt.warmup=true

-Djnlpx.origFilenameArg=/Users/Myuser/Desktop/login.jsp

-Djnlpx.remove=true

-Xincgc

-Xms64m

-Xmx256m

-Djnlpx.heapsize=64m,256m

-Xdock:name=Contact On Demand

-Dapple.javaws.dock.name=Contact On Demand

-Xdock:icon=/System/Library/Frameworks/JavaVM.framework/Resources/WebStart.icns

-Dapple.javaws.dock.icon=/System/Library/Frameworks/JavaVM.framework/Resources/ WebStart.icns

-Dapple.awt.UIElement=true

-Djnlpx.splashport=54068

-Djnlpx.jvm=/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bi n/java

-Djnlpx.vmargs=-Xincgc

com.sun.javaws.Main

/var/tmp/javawsoQwo8C


On the end application say me error login task... I think take a strange login, because i give the long path or something else.... I don't know...

Jun 18, 2012 7:44 AM in response to Mark Jalbert

OK sorry.

In any case If I Enable box: Enable applet plugin and Web Start applications box, and close it, and reopen it, is loose I active it.

in any case it didn't work, ask me to activate manually with a pop-up, but never leae the config i put there.

i try to use 32bits java switching it, but same problem, every time i open it again loose config of it.


Error is the same:

TigreDARK:~ Myuser$ javaws /Users/Myuser/Desktop/login.jsp

No Java runtime present, requesting install.

Unable to locate a Java Runtime to invoke.

TigreDARK:~ Myuser$

Jun 18, 2012 9:31 AM in response to TigreDARK

Thanks to Brody and Mark Jalbert to help me to find the problem I hope this not ocurred again.


I give some feedback if this problem ocurred to other person, I see same error from 2009/2010... so is not a current problem, is a MacOS software problem of folders/permissions.


Best regards!


========================================================

Now I reboot, and all is solved (I already reboot 3 times and check and uncheck box you say).


Now something change=

TigreDARK:~ Myuser$ /usr/libexec/PlistBuddy -c "Print" $HOME/Library/Preferences/ByHost/com.apple.java.JavaPreferences.*

Dict {

GeneralByTask = Dict {

Any = Dict {

PrefsVersion = 2

WebComponentsLastUsed = 361728896.000000

WebComponentsEnabled = true

}

}

}

TigreDARK:~ Myuser$

=====================================================


IMPORTANT:

Is not a good idea to add permissions to all folders, and give wrong permissions or more permissions o files.... is really danger, please do a backup first if you want to do a test...

I think the permissions, and the reboot solve, but I'm not sure what really do this change....



how i fix the problem:

1)

/System/Library/Java/Support/Deploy.bundle/Contents/Resources/Java

files i add permissions of my user, and write read:

deploy.jar

javaws.jar


2)

/System/Library/Java/Support/Deploy.bundle/Contents/Home/Lib

I add here too a R+W permission to "system" and to my user r+w


3)

I moved the ~/Library/Preferences/ByHost/com.apple.java.JavaPreferences.*.plist file and ran Java Preferences again.


4) Shutdown, and boot again.



IF PROBLEM PERSIST:=

Go to folder of JAVAWS path:

cd /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin

Lunch you jsp application:

TigreDARK:bin XXXXXXX$ ./javaws /Users/myuser/Desktop/login.jsp


If give you this error, like my error PROBLEM, is a permission of files problem....


TigreDARK:bin XXXXXXXX$ Error occurred during initialization of VM

java/lang/ClassNotFoundException: error in opening JAR file <Permission denied> /System/Library/Java/Support/Deploy.bundle/Contents/Home/lib/deploy.jar



Javaws error "Unable to locate a Java Runtime to invoke"

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.