Using Ant with Flex - eclipse

I'm having problems setting up Ant to use with Flex. I install it fine but I get this error when I try and check the install: Unable to locate tools.jar.
From what I've read, I just need to point JAVA_HOME to the directory that contains the jdk. Unfortunately, I'm not sure I know which jre I'm using in Eclipse and also, I do a search for tools.jar on my machine and it's not there???
I have a C:\Program Files\Java directory and there is this in there:
j2re1.4.2_05
jdk1.6.0_03
jre1.6.0.23
In Eclipse --> Windows --> Preferences --Java --> Installed JREs, it's pointing to here:
eclipse-host-distro, C:\Program Files\Adobe\Adobe Flash Builder Plug-in\eclipse-host-distro
Am I not working with a full JRE?
Any tips are greatly appreciated. Thank you in advance.

Just specify your JAVA_HOME path as C:\Program Files\Java\jdk1.6.0_03\ and everything should be good as long as the JDK was properly installed. If that doesn't work, get the latest and try again.

Related

How to set JAVA_HOME in maven in Windows7 correctly

I am facing Issues in running MVN commands from command line though I am able to successfully run with eclipse.
> mvn -version
**Maven home:** D:\maven **Java version:** 1.7.0_45, vendor: Oracle Corporation
**Java home:** C:\Program Files (x86)\Java\jre7
etc etc.....
> echo %JAVA_HOME%
D:\ProgramFiles\Java\jdk1.7.0_25
User Variable Set JAVA_HOME to D:\ProgramFiles\Java\jdk1.7.0_25; and path to D:\ProgramFiles\Java\jdk1.7.0_25\bin.
I have already JDK 1.6 installed in default drive C below. C:\Program Files (x86)\Java\jdk1.6.0_27,C:\Program Files (x86)\Java\jre7
As per project requirement, we needed JDK1.7 installed. Due to permission issues (not able to install C drive), I installed JDK 1.7 in path D:\ProgramFiles\Java\jdk1.7.0_25,D:\ProgramFiles\Java\jre7.
On Eclipse pointing to JDK1.7 for installed JREs. And able to run all MAVEN Commands via eclipse. But note, the library files for jre is still pointing to C drive lib jar files only and not D drive jar files.(But as eclipse is working good I ignored this!)
But from command line getting error as "Perhaps you are running on a JRE rather than a JDK". No compiler etc. on running any maven command. Also maven's JAVA_HOME is still pointing to jre of C drive on running mvn -version.
Please help how to correct my problem. (Without uninstalling older version of Java As i dnt have permission to C drive folder)
Thanks in advance for help. :)

Setting JRE in Netbeans

I have JDK 1.6, JRE6 and JRE7 (64-bit & 32-bit) installed in my PC.
I am using Netbeans 7.3 BETA 2 and it is using JDK 6 and JRE 6.
I want to change it to JRE7. How can i achieve this ?
I have checked in Stackoverflow itself and found that we have to change the netbeans.conf file content for the netbeans_jdkhome value to the path of new Java path.
In another stackoverflow question, I found How to specify which JRE to use in Netbeans?.
But, in this also, I am not able to find how to get this resolved. Can anybody help on this ?
My installation path is as follows,
JDK6 path - C:\Program Files (x86)\Java\jdk1.6.0_31
JRE6 path - C:\Program Files (x86)\Java\jre6
JRE7 path - C:\Program Files (x86)\Java\jre7 (32-bit)
JRE7 path - C:\Program Files\Java\jre7 (64-bit)
Thanks in advance.
Goto Tools -> Platforms
Click "Add Platform", browse to the location where the JDK you want to add is installed....
Click on the JDK you want to add and select "Finish"
Updating projects
You can change the platform that projects use, by right clicking the project node and selecting properties and selecting Libraries. Here you change the platform that the project will use to build the classes with.
You can also change the source/binary format (version) which Netbeans is expecting to use. For example, you use JDK 7, but build/develop for Java 6
Changing the JDK that Netbeans itself uses to run
Goto {install/location/of/Netbeans}/etc and open the netbeans.conf.
There is a property called netbeans_jdkhome (it was towards the end of my file). You change this to what ever JDK you want Netbeans to be launched with

Eclipse JRE or JDK missing

I am trying to use Eclipse on a friends computer but we keep getting this when we run Eclipse
We have the environmental variable set as well.
Edit
it was working before he installed the black berry plug in.
The variable JAVA_HOME is not required by Eclipse. If your Java installation does not put the Java executables in the PATH, you should add those manually.
A faster way to have your Eclipse up and running consists in modifying the eclipse.ini and using the -vm option.
http://wiki.eclipse.org/Eclipse.ini#-vm_value:_Windows_Example
I had the same problem. For me, I needed the JDK. So I had to install the JDK. It should match the build platform that is, 64bit vs. 32bit windows. After that, I removed, the -vm line from the eclipse.ini file (the suggested fix). It was giving me the "Can't create virtual machine" error. The current release of JDK is version, 7 whereas the Android Developers Toolkit version of eclipse is currently based on JDK 6. But it seems to work. Eclipse came up and is functional. Haven't actually written a program yet.
Go to eclipse folder (where eclipse is installed) and open eclipse.ini file in your editor and add the following code after openFile tag.
-vm C:\Program Files\JDK6\bin\javaw.exe
That's all.
I had a similar problem, since our Java and JDK is consistently updated by our service desk, including uninstalling old JDKs. They take care of the PATH for us, but then the JRE that Eclipse was used to "seeing" was gone. So, the thing that has worked best for me is to modify the shortcut's "target" from:
"C:\Program Files\Eclipse\Eclipse IDE for Java EE Developers\eclipse.exe"
to
"C:\Program Files\Eclipse\Eclipse IDE for Java EE Developers\eclipse.exe" -vm "C:\Program Files\Java\<jdkver>\jre\bin\javaw.exe"
That will point Eclipse toward to the JRE in the JDK you want it to use, and then you can update that shortcut when your JDK updates.
This is on Windows 64bit, obviously.
It can also happen on mismatch of JAVA and Eclipse bit version.
for eg:
If in your System java is 32 bit and you are trying to install Eclipse of 64 bit then the same situation might occur.
Because Eclipse will look Java in Program Files while at the same time Java may be present in Program Files (x86).
So in this case eclipse will not get java and throw the same error.
While installing eclipse, Jre missing :
I solved my error as follows:-
This error may comes if you have 2 program files folder in your system.
"Program files" &
"Program files x86".
Please install JDK&JRE in the "Program files" folder.
Hope your jre missing error get solved.
this works for me:
open eclipse.ini file in your editor and add the line: -vm C:\Program Files\JDK11\bin\javaw.exe
update system PATH with correct JDK path.

problem running eclipse on ubuntu?

I downloaded eclipse on ubuntu. But when I run it it show following error.
A Java Runtime Environment (JRE) or Java Development Kit (JDK)
must be available in order to run Eclipse. No Java virtual machine
was found after searching the following locations:
/home/awan/eclipse/jre/bin/java
java in your current PATH
Can someone help me to solve this. I don't have experience about this on ubuntu.
thanks
You need to install either the openjdk-7-jre or oracle-java7-jre package.
sudo apt-get install openjdk-7-jre
Note that openjdk-7-jre is easier to install, because it's available via the standard Ubuntu repository, whereas you have to build oracle-java7-jre yourself using java-package.
If you allready installed java** you need to add the Java-Path to your eclipse.ini
in my case it's located at:
/usr/lib/eclipse/eclipse.ini
there you need to add direct under the "openFile" statement, where you replace the path with your java path:
-vm
/usr/lib/jvm/java-7-openjdk/bin/java //!replace with your path to java!
** check wether java is installed by typing the commands
java -version
or
javac -version
If you are sure that java is installed, but it's not found you may have multiple versions installed, check that by:
sudo update-alternatives --config java
and select installation first
I solved it by created a symbolic link java in /usr/bin that points to the VM.
Steps :
Downloaded the appropriate version of Oracle's JDK from http://www.oracle.com/technetwork/java/javase/downloads/index.html?ssSourceSiteId=otnjp
extract it to any folder. For example :
tar zxvf ~/Downloads/jdk-8u5-linux-x64.tar.gz ~/DEV
create symbolic link with name java :
cd /usr/bin
ln -s ~/DEV/jdk1.8.0_05/bin/java java
You need to add the JDK to your PATH.
This link should help you get started.
You need to install the JDK or OpenJDK (Eclipse only officially supports the former, but the latter mostly works).
I solved this error message by adding jre path in to eclipse.ini.To solve the error like this,your machine should have java installed.
In my setup eclipse.ini is in
eclipse-jee-mars-linux-gtk-x86_64-5.0.0/eclipse folder.
Add,
-vm /home/user/Documents/Softwares/jdk-8u202-linux-x64/jdk1.8.0_202/jre/bin
at the top of the file.
In here /home/user/Documents/Softwares/jdk-8u202-linux-x64/jdk1.8.0_202 is my JAVA_HOME
For me, directing JDK path to -vm didn't work.I had to put the jre/bin path which is inside jdk folder.
You need to have a Java environment that can execute the Java instructions in Eclipse for it to run.
Install a suitable Java package in the package manager, and try again. Note that Eclipse does not require a JDK, a JRE is enough.
I tried editing .profile, .bashrc, to no avail. (I'm trying to use eclipse by clicking an icon, NOT by executing it from a bash shell).
SOLUTION: I copied my /home/denise/jdk1.7.0_25/jre to
/home/denise/dev//jre
which is a stupid solution because it defeats the purpose of having a .profile or .bashrc.
and no, there was no .pam_environment file
peace!
I had similar problem. It solved after, I have download JRE from http://www.oracle.com/technetwork/java/javase/downloads/jre7-downloads-1880261.html
and put it in the path of eclipse as shown below -
abc#ubuntu:~/Downloads/eclipse$ ls
about_files
configuration
eclipse.ini
icon.xpm
p2
about.html
dropins
epl-v10.html
jre
plugins
artifacts.xml
eclipse
features
notice.html
readme
I hope it helps.
First of all you need to set your JAVA path in .bashrc file.
goto cd ~
open .bashrc,vi .bashrc
add a line at the end export path="path/to dir:$path"
do source .bashrc for changes to take effect.
Then open your eclipse.ini file(if you want to locate eclipse.ini do whereis eclipse).
open eclipse.ini,then add a line
-vm
"path/to/bin/of/open-jdk"
Just copy jre and paste in eclipse folder that's it. After this just click on eclipse icon to launch eclipse. Thanks.
artifacts.xml
configuration
dropins
eclipse
eclipse.ini
features
icon.xpm
jre
p2
plugins
readme

Eclipse will not start after uninstalling Java and reinstalling to a new location

I reinstalled the JDK tonight because of the embedded space in Program File... and now Eclipse blows up immediately when starting. Is there a config file that needs updating? I tried eclipse -clean with nu luck.
while eclipse starting it requires java.exe and javaw.exe. so when you installed it at other places. you should specify its location in PATH variable so that it can be used to locate your JVM.
EDIT: and of course remove the old entry.
I know this question has already been solved but i want to share a small detail. if you are using -vm option in eclipse.ini, make sure that it is written before -vmargs option.
in my case below configuration didn't worked
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m
-vm
C:\ibm_jdk_6\bin\javaw.exe
but below configuration worked
-vm
C:\ibm_jdk_6\bin\javaw.exe
-vmargs
What OS are you using? You need to let eclipse know where your jdk lives. On windows at least it is in the exclipse.ini, change it to put to your knew jdk and it will work
for example on windows you will need something like this in your eclipse.ini
-vm
C:\jdk1.6.0_02\jre\bin\java
You can find your eclipse.ini in the root directory of your eclipse installation (ie: where eclipse.exe is)
You must have fixed this problem by now but I don't see anything in this thread to indicate that.
I just had the same problem. I updated JDK. The next time I tried to start Eclipse it wouldn't. I fixed the problem by removing all older versions of java and setting the new version in my PATH system environment variable. Actually, I also reinstalled my eclipse but I don't think that had anything to do with the solution. By the way, I'm using Eclipse Galileo (Build id: 20090621-0832) and jdk1.6.0_021.
did you eclipse.ini file in the eclipse directory point to a specific -vm? You may need to change it in your eclipse directory.
You can also get this error if you have a 64-bit jre and 32-bit eclipse, so just make sure your jre and eclipse build match up!
Use the eclipse clean command; it will make clean and elipse will start
GOTO_Eclipse_Directory > eclipse -clean
Refer below url : http://www.coderanch.com/t/454501/vc/eclipse-exe-not-working
Pre append the string in system variable PATH: "C:\Program Files\Java\jdk1.6.0_22\jre\bin;"
Then every thing will work fine.
For me Eclipse was not starting because I had two versions of Java 5 & Java 6 installed. I uninstalled 6, and then it started working. So better to see if uninstallation of one version solves the problem.
I got the same problem When i Installed the java update 38....
resolved by uninstalling the update.
Eclipse was able to locate the JRE however it failed to launch because the eclipse that I had downloaded was 32 bit and my jdk version was 64bit. I uninstalled 64bit jdk and installed 32bit. Eclipse launched successfully
You don't have to uninstall anything. Just go to the eclipse folder in the eclipse configuration setting and change the class path to C:\Program Files\Java\jdk-9.0.1\bin.