"Error: JAVA_HOME is not defined correctly." in construction jikes rvm

When I built Jikes RVM on Unbuntu, I got this error. Any idea?

  bin / buildit localhost production
 ---> Config: production
 / bin / bash --login -c '/ bin / bash --login -c "cd /home/jack/Programs/jikesrvm-3.1.2 && export JAVA_HOME = / opt / jdk1.6.0 && ant very-clean -Dhost .name = ia32-linux && ant check-components-properties -Dhost.name = ia32-linux -Dtarget.name = ia32-linux -Dcomponents.cache.dir = / home / jack / .buildit_components_cache && ant -Dtarget.name = ia32-linux -Dconfig.name = production -Dhg.revision = -Dhost.name = ia32-linux -Dcomponents.cache.dir = / home / jack / .buildit_components_cache "' 
 Error: JAVA_HOME is not defined correctly.
   We cannot execute /opt/jdk1.6.0/bin/java
 Wed Jun 13 12:23:37 EDT 2012
 ====================== Summary ======================
 Local: /home/jack/Programs/jikesrvm-3.1.2
 Build: ubuntu: /home/jack/Programs/jikesrvm-3.1.2
 Target: ubuntu: /home/jack/Programs/jikesrvm-3.1.2
 Start: Wed Jun 13 12:23:37 EDT 2012
 Config: production [FAILED Wed Jun 13 12:23:37 EDT 2012]
 =================================================== =

OS:

  Linux ubuntu 2.6.32-24-generic # 39-Ubuntu SMP Wed Jul 28 06:07:29 UTC 2010 i686 GNU / Linux 

Environmental Variables: PATH

  /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/lib/jvm/java-6-sun-1.6. 0.22 / bin 

JAVA_HOME

 /usr/lib/jvm/java-6-sun-1.6.0.22 

I checked java in the JAVA_HOME/bin , it works. No matter how I change the environment variables, the error kept complaining: "We cannot execute / opt / jdk 1.6.0 / bin / java." It seems that I did not change the correct "position".

Any clue?

Thanks!

+6
source share
4 answers

run the following command:

 find . -exec grep "jdk1.6.0" {} \; 

To find out which file sets JAVA_HOME to this path.

+7
source

While you are creating jikes, you can either build it with ant, or using the command you use. If the JAVA_HOME problem causes problems using

 bin/buildit localhost production -j"path to your jvm directory" 

-This is present in " /usr/bin/jvm ".

Another method: there is bin / buildit.base_config, which specifically specifies the path for JAVA_HOME. Therefore, in the " # Default JAVA_HOME values " section, you can change the corresponding location, for example,

 global.javahome.ppc32-linux=/usr/lib/jvm/java-6-sun-1.6.0.26 global.javahome.ppc64-linux=/usr/lib/jvm/java-6-sun-1.6.0.26 global.javahome.ia32-linux=/usr/lib/jvm/java-6-sun-1.6.0.26 global.javahome.x86_64-linux=/usr/lib/jvm/java-6-sun-1.6.0.26 

You can choose which one you want to use. If you are not familiar with your architecture, change everything and now you can build without worrying about your java path being explicitly specified. Check out this blog for more details.

I also wrote a short article on how to start playing with Jikes

+3
source

This is a JRE, but not a JDK. Install the JDK and hover JAVA_HOME at it.

0
source

You may get this error due to several reasons. To quickly fix this, follow these steps:

First find the java location. To get a list of installed Java platforms, run the following command from the terminal:

 $ sudo update-alternatives --config java 

Now set JAVA_HOME and PATH,

 $ export JAVA_HOME=<java_home> $ export PATH=$JAVA_HOME/jre/bin:$PATH 

Create a symlink

 $ sudo ln -s <java_home>/jre <java_symlink_path> 

When we take your case as an example:

 $ sudo ln -s /usr/lib/jvm/java-6-sun-1.6.0.22/jre /opt/jdk1.6.0 

The above command will create a symlink location where the system is trying to find in your problem.

Finally, try your app.

-1
source

Source: https://habr.com/ru/post/918001/


All Articles