java
sql
html
iphone
css
c
python
mysql
linux
flash
algorithm
cocoa
tsql
apache
php5
asp
api
jsp
postgresql
dom
I ran into the same problem and the way I was able to resolve it was add the dependency location of tools.jar into the pom.xml. Like so:
<dependency> <groupId>com.sun</groupId> <artifactId>tools</artifactId> <version>1.6</version> <scope>system</scope> <systemPath>C:\Program Files\Java\jdk1.6.0_29\lib\tools.jar</systemPath> </dependency>
Make sure you change the systemPath to where ever your tools.jar file is located.
I just posted over on this question about this same issue and how I resolved it, but I'll paste (and expand on) it here as well, since it seems more relevant.
I had the same issue when using Eclipse in Windows 7, even when I removed the JRE from the list of JREs in the Eclipse settings and just had the JDK there.
What I ended up having to do (as you mentioned in your question) was modify the command-line for the shortcut I use to launch Eclipse to add the -vm argument to it like so:
-vm "T:\Program Files\Java\jdk1.6.0_26\bin"
Of course, you would adjust that to point to the bin directory of your JDK install. What this does is cause Eclipse itself to be running using the JDK instead of JRE, and then it's able to find the tools.jar properly.
tools.jar
I believe this has to do with how Eclipse finds its default JRE when none is specified. I'm guessing it tends to prefer JRE over JDK (why, I don't know) and goes for the first compatible JRE it finds. And if it's going off of Windows registry keys like Vladiat0r's answer suggests, it looks for the HKLM\Software\JavaSoft\Java Runtime Environment key first instead of the HKLM\Software\JavaSoft\Java Development Kit key.
HKLM\Software\JavaSoft\Java Runtime Environment
HKLM\Software\JavaSoft\Java Development Kit
If you are using the openjdk then you need to install the openjdk-6-sdk package.
In the effective POM tab of the pom files, I see the following derive path: C:\Program Files\Java\jre6/../lib/tools.jar and I think it's not a valid path in Windows. I tried copying the tools.jar in the jre6/lib folder as well as in Java/lib without success.
C:\Program Files\Java\jre6/../lib/tools.jar
The value "C:\Program Files\Java\jre6" comes from the registry
HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\1.6.0_30 HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\1.6
And set the JavaHome key to where your jdk JRE is installed. Then all the compiler errors went away.
Reinstalling the JDK didn't fix it. Setting the JAVA_HOME or java.home system environment variable didn't help.
The other alternative I've seen is adding the dependency with the right path in each pom xml file, but the playn-samples has lots of files that is a ridiculous pain to have to edit.
This is the effective POM results, which show the WRONG path!
<dependency> <groupId>com.sun</groupId> <artifactId>tools</artifactId> <version>1.6</version> <scope>system</scope> <systemPath>C:\Program Files\Java\jre6/../lib/tools.jar</systemPath> <optional>true</optional> </dependency>
Changing the relative location of ${java.home}/../lib/tools.jar to the absolute path of C:\Program Files\Java\jdk1.6.0_29\lib\tools.jar works for me. You should only have to change it in the playn/pom.xml Now for the playn-samples, Vladiator is right, that's too many pom files to change.