Page 1 of 1
JRE Installation Not Located
Posted: 01 May 2011, 22:59
by msm8bball
I'm getting the following error when I use any Java AI:
[f=0000000] ERROR: Initializing AI Interface library from file "C:\Program Files (x86)\Spring\AI\Interfaces\Java\0.1\AIInterface.dll". The call to initStatic() returned unsuccessfuly.
I've traced this back to the interface-log.txt which shows the following error:
05/01/11 15:52:21 / ERROR(1): Failed locating a JRE installation, you may specify the JAVA_HOME env var.
I've tried multiple times to set my JAVA_HOME env variable, but not having much success. I can pull up a command prompt and type "java" and I'm getting the java executable. So I know other programs are finding it. I've tried the following different values:
"C:\Program Files\Java\jre6\"
"C:\Program Files\Java\jre6\bin"
C:\Program Files\Java\jre6\
C:\Program Files\Java\jre6\bin
I'm on Win 7 64 bit if that makes a difference.
Any suggestions?
Re: JRE Installation Not Located
Posted: 02 May 2011, 02:11
by Forboding Angel
http://www.java.com/en/download/index.jsp
JRE Stands for "Java Runtime Environment". Java Runtime Environment being the Environment in which it runs Java Programs.
Can't locate your JRE install is basically saying, you don't have Java installed Foo! But some developer decided to be cryptic.
Re: JRE Installation Not Located
Posted: 02 May 2011, 02:52
by msm8bball
Forboding Angel wrote:http://www.java.com/en/download/index.jsp
JRE Stands for "Java Runtime Environment". Java Runtime Environment being the Environment in which it runs Java Programs.
Can't locate your JRE install is basically saying, you don't have Java installed Foo! But some developer decided to be cryptic.
Yes, the JRE contains the Java Virtual Machine that abstracts out all the underlying stuff so that you can write your code once, run it anywhere so long as they have the JRE.
I know what it is, I do development in Java. Do you know why Spring can't find it when I have set up the JAVA_HOME environment variable properly?
Re: JRE Installation Not Located
Posted: 02 May 2011, 15:40
by hoijui
java.exe beeing found and JAVA_HOME beeing set are different things. escpecially cause (at least on winXP), java.exe is installed in some global binarz dir on windows, and JAVA_HOME is not automatically set on install. if i remember right, it also reads the registrz on windows, to find JRE, so JAVA_HOME is only the last resort.
as you say you set JAVA_HOME properly.. i dont know what it could be. the Java-AIInterface laods hte jvm directlz, so it uses a dll )i think jvm.dll or something like that), not java.exe.
Re: JRE Installation Not Located
Posted: 02 May 2011, 19:03
by smoth
Oh zogock, why you so crazy. Now I want to model you but you is borderline no canon
Re: JRE Installation Not Located
Posted: 02 May 2011, 20:30
by cranphin
Sheesh, kids :)
Install 32 bit Java besides your 64 bit java, and make sure JAVA_HOME points to that :)
Spring is 32 bit, so needs a 32 bit JRE.
64 bit windows:
I'm on Win 7 64 bit if that makes a difference.
64 bit Java, since 32 bit is kept in "C:\Program Files (x86)"
"C:\Program Files\Java\jre6\"
Re: JRE Installation Not Located
Posted: 02 May 2011, 20:44
by msm8bball
cranphin wrote:Sheesh, kids :)
Install 32 bit Java besides your 64 bit java, and make sure JAVA_HOME points to that :)
Spring is 32 bit, so needs a 32 bit JRE.
64 bit windows:
I'm on Win 7 64 bit if that makes a difference.
64 bit Java, since 32 bit is kept in "C:\Program Files (x86)"
"C:\Program Files\Java\jre6\"
Is it a good idea to run 32bit JRE alongside 64 bit?
Why doesn't Spring just use the JAVA_HOME env variable and therefore launch the 64bit version?
I'm not at my computer right now, but I'll do as you suggest when I get to it.
Re: JRE Installation Not Located
Posted: 02 May 2011, 21:10
by AF
Is it a good idea to run 32bit JRE alongside 64 bit?
Why doesn't Spring just use the JAVA_HOME env variable and therefore launch the 64bit version?
Because spring under windows is 32bit and you cant mix a 32bit C++ with 64bit Java VM
Re: JRE Installation Not Located
Posted: 02 May 2011, 23:12
by cranphin
msm8bball wrote:Is it a good idea to run 32bit JRE alongside 64 bit?
Why doesn't Spring just use the JAVA_HOME env variable and therefore launch the 64bit version?
I'm not at my computer right now, but I'll do as you suggest when I get to it.
I wondered the same. But it's what I'm running now :) Win7 64 bit, with both 64bit and 32bit Java installed.
I installed 32 bit Java first, then 64 bit, so that 64 bit is the preferred one. It probably overwrites the stuff that points to the java version to use (registry settings, + java.exe in your Windows\System32 folder). (Seems to work, haven't tried it the other way round).
Result for me is that standalone Minecraft runs 64 bit java, both 32 bit/ 64 bit browsers get their correct java, and Spring uses 32 bit Java, and runs my own Java AI fine :)
PS, oh, and what AF sayd. You cannot mix a 32 bit executable (Spring.exe), with 64 bit dll's (jvm.dll, used to integrate Java into Spring). That's why Spring won't run with 64 bit Java. If we ever get a 64 bit windows build of Spring, it will run :)
Re: JRE Installation Not Located
Posted: 03 May 2011, 00:44
by msm8bball
Guys, thanks for the help. I installed the 32bit JRE alongside the 64bit and got it to work after I pointed JAVA_HOME to the 32bit directory.
Hugh, if you look at this, I'm having some trouble getting your AI to run. Now that I got the JRE configured properly (NullOOJavaAI runs), I can't get yours to run. I get an exception violation. I know you like pastebin so here you go:
http://pastebin.com/KHVfRb53
I compiled it from source. Did I do something wrong?
Re: JRE Installation Not Located
Posted: 03 May 2011, 01:25
by msm8bball
By the way, you guy's argument is unnecessary. I should have posted from the beginning that I was somewhat experienced and that I had the JRE installed.
I've taken a look at HughAI and a lot of it was over my head, because I don't fully understand everything yet. But hopefully with some time that will change.
I think the biggest contribution I can make is creating a guide to get started with Java AI development. The Java tutorial we have stickied right now is kind of dated, and the wiki one is even worse off (which is sad, because a wiki would be the best way to display the information).
Re: JRE Installation Not Located
Posted: 03 May 2011, 13:48
by AF
Any quickstart guides be it for setting up a Java AI or working with the API would be most welcome
Re: JRE Installation Not Located
Posted: 03 May 2011, 23:23
by cranphin
msm8bball wrote:I think the biggest contribution I can make is creating a guide to get started with Java AI development. The Java tutorial we have stickied right now is kind of dated, and the wiki one is even worse off (which is sad, because a wiki would be the best way to display the information).
I'm willing to help with that, I do actually kinda maintain a Java AI, even tho it's not much usefull since it's mostly a straight port of KAIK :)
PM for questions, or even better, grab hold of me on SpringLobby #ai :)
Will see if I can help with the HughAI pastebin thing ^_^
But not today, hossieriding day, only have a few mins PC time :)
Re: JRE Installation Not Located
Posted: 04 May 2011, 00:41
by msm8bball
cranphin wrote:msm8bball wrote:I think the biggest contribution I can make is creating a guide to get started with Java AI development. The Java tutorial we have stickied right now is kind of dated, and the wiki one is even worse off (which is sad, because a wiki would be the best way to display the information).
I'm willing to help with that, I do actually kinda maintain a Java AI, even tho it's not much usefull since it's mostly a straight port of KAIK :)
PM for questions, or even better, grab hold of me on SpringLobby #ai :)
Will see if I can help with the HughAI pastebin thing ^_^
But not today, hossieriding day, only have a few mins PC time :)
I probably won't start today. I have college final exams this week. But it should be a good way to catch up on my Java this summer.
Re: JRE Installation Not Located
Posted: 04 May 2011, 19:24
by cranphin
HughAI in master seems to work, some issues cause of recent Spring changes, but atleast it starts and stuff :)
I assume you use release prebuilt Spring, and not sure which version of HughAI you're compiling :)
Could you indicate how you're building HughAI, and from which sources?
Would help, then I can try to reproduce your problem ^_^
It's worth considering switching to master (aka the last source version of Spring in development), tho it certainly takes more effort.
But there's been some significant changes/improvements relating to AI's and especially Java AI's :)
Hmm, I'll go and install latest release Spring too I gues ^_^