3

I've been working on Aptana Studio and some JRE required software for a bit of time now , but since yesterday something quite odd happened, as suddenly the software that requires it threw me an error No Java virtual machine was found . Last thing I did before that was restoring my system files permissions thought safe mode as I had some trouble with that , could this have anything to do with it ?

I've tried installing JRE once again , no results. However when I run

/Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java -version

I do get the following

java version "1.7.0_55"
Java(TM) SE Runtime Environment (build 1.7.0_55-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.55-b03, mixed mode)

Aptana gives me the following error

No Java virtual machine
was found after searching the following locations:
/Applications/Aptana Studio 3/AptanaStudio3.app/Contents/MacOS/jre/bin/java
java in your current PATH

And other software such as Spine won't simply start.

My .bash_profile is the following :

PATH="/Library/Frameworks/Python.framework/Versions/3.4/bin:${PATH}"
PATH="/Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home/bin:${PAT$
export PATH
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home

The output of echo $PATHis the following

/Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home/bin:/Library/Frameworks/Python.framework/Versions/3.4/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin

The output of echo $JAVA_HOME is the following

/Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home

And Java invocations on the terminal work.

Guidance will be highly appreciated.

JRE Error

Joel Hernandez
  • 1,817
  • 4
  • 18
  • 27
  • Just change your PATH EV to include the JRE: http://stackoverflow.com/questions/12089697/how-to-set-java-jdk-environment-variable-for-mac-os-x-10-8-mountain-lion – John Apr 17 '14 at 16:58
  • I set the JAVA_HOME environment variable as the post referred by @John , echoed it and everything seems fine, but yet no result on runtime. – Joel Hernandez Apr 17 '14 at 17:06
  • @JoelHernandez do you still get the error? – John Apr 17 '14 at 17:07
  • @GriffinG Java bin directory is on $PATH too, I can invoke it with no problem from the Terminal yet same issue resides. – Joel Hernandez Apr 17 '14 at 17:12
  • @JoelHernandez I've just tried in my mac, and I do not have such a path : ..MacOS/jre/bin/java. And it starts just fine. weird.. – Eugene Apr 17 '14 at 18:19
  • Path for OsX GUI apps is strange and confusing, posted some links in my answer for those interested. :) – Peter Svensson Apr 17 '14 at 19:01
  • http://stackoverflow.com/questions/9602704/java-error-causing-aptana-not-to-run?rq=1 – Aakash Apr 18 '14 at 05:37
  • Hello @AakashGoyal ,I did tried that but with no result, I posted the true solution for my issue below. Cheers. – Joel Hernandez Apr 18 '14 at 05:39

4 Answers4

2

After trying Peter's suggestion the problem persisted but now in another context : "/System/Library/Frameworks/JavaVM.framework" does not contain the JNI_CreateJavaVM symbol"

After struggling for many hours, and reading about people with the same issue opting to re-install the entire OS , decided to examine the issue from another perspective, the thing I first mentioned here that I believe went unnoticed was that I restored my permissions before this happening, so what I did was the following.

  1. After reading a bunch of articles about Apple no longer providing Java support themselves but Oracle providing it, reasoned through it and realized that perhaps paths (Often called directories) from Apple's final Java release may have not been strictly the same as the new Oracle releases, so decided to wipe out all recent Oracle Java Runtime Environment that I found on /Library/Java/JavaVirtualMachines and delete the Java Applet Plugin from /Applications (Just search for it on your /Applications path) .
  2. Installed Apple's last stable release from the following link.
  3. Located where Apple located their Java releases : /System/Library/Frameworks/
  4. My particular interest was the Java Runtime Environment , so I explored the JavaVM directory on /System/Library/Frameworks/
  5. Found out that all Apple's JRE previous releases reside on a directory called Versions that is within /System/Library/Frameworks/JavaVM.framework directory, here's where I noticed something rare, for some reason at the moment I restored file permissions from my Disk Utility Application , this directory was made inaccessible (By not giving the root user permissions to access anything in itself).
  6. Went to my terminal console and inside the JavaVM.framework directory modified the permissions to that directory to be accessible for all users by running the following command chmod -R 777 Versions.

After executing these actions I went straight to my JRE-Required software and attempted to open it , success!

Things to learn from the issue.

  • Oracle's Java JDK/JRE are located in different paths from Apple's. (If you are struggling with some other issue, verify your Java version to determine your Java installation directory)
  • Apple's disk utility application might define different permissions than expected for some files. (After restoring permissions verify that everything's working fine, if not this may be the cause of your problems.)
Joel Hernandez
  • 1,817
  • 4
  • 18
  • 27
0

Looks like AptanaStudio (Eclisebased right?) assumes that you have a JRE inside the Aptana directory (/Applications/Aptana Studio 3/AptanaStudio3.app/Contents/MacOS/jre/bin/java)

I assume that there is nothing there. Simplest way would be to symlink your existing JRE installation to that directory:

ln -s  /Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home/jre /Applications/Aptana\ Studio\ 3/AptanaStudio3.app/Contents/MacOS/jre

Or you could start Aptana from the terminal and specify the path to java with -vm:

./aptana -vm "/path/to/java/bin/directory"

Environment variables that must be available to GUI applications are a bit tricky in OsX (at least in my experience). It is possible to set global PATH (and other variables) in /etc/launchd.conf, see for example here and /etc/paths.d see here.

Community
  • 1
  • 1
Peter Svensson
  • 6,105
  • 1
  • 31
  • 31
  • Thanks for the answer Peter, have to go on an urgent matter , as soon as I come back I'll attempt it and will let you know! (To mark the answer as correct if so). – Joel Hernandez Apr 17 '14 at 18:32
  • Hello Peter! I'm afraid that the solution was not that simple, I did got to understand better the problem by applying your suggestion so I'm truly thankful! I'f you are interested on the solution, I've posted it below. Cheers! – Joel Hernandez Apr 18 '14 at 05:34
  • I had the same problem with OS X Yosemite, JDK 8 and Aptana 3 - I just installed the apple Java link as well and Aptana started working. So i possibly have two JVMs running in the machine but Aptana seems to ignore the JDK 8 and only use the older version provided by Apple. This will have to ultimately be resolved by Aptana team but until then this is a workaround – ChicagoSky Oct 23 '14 at 20:04
0

Simple Solution

For Windows: 1.download the JAVA runtime environment x86(32bit) version else you will get an error with dll file from here http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html

  1. Extract the folder out of the .tar file you downloaded.
  2. Rename the JRE folder to "jre"
  3. Then paste it in to this directory C:\Users\"User Name"\AppData\Roaming\Appcelerator\Aptana Studio

This worked for me

Hitesh Bisht
  • 486
  • 1
  • 6
  • 11
0

I uninstalled all my Java JREs and JDK for Windows 10. Then I downloaded Aptana again and let it install Java for me. I think JAVA 8 was my problem, but this worked and I can still install the other versions again.

DDJ
  • 807
  • 5
  • 13
  • 31