Hi.
I'm pretty new to this but eager to learn, so I'm hoping this doesn't come of as a stupid Q.
And hopefully someone on here has an answer.
I've been trying to build Sweethome 3D using Eclipse and the Build.xml but have run into some minor issues.
First I get this
-----------------------------------------
..\workspace\SweetHome3D\build.xml:40: Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "C:\Program Files\Java\jre6"
-------------------------------------------------------------
I added tools.jar from jdk 1.6.0_17 to the Ant runtime classpath and sure enough that worked.(probably the wrong way to go about it)
Then this when building src\com\eteks\sweethome3d\applet\SweetHome3DApplet.java using Ant and the Build.xml
---------------------------------------------------------------
:231: annotations are not supported in -source 1.3
[javac] (use -source 5 or higher to enable annotations)
[javac] @SuppressWarnings("unchecked")
[javac] ^
[javac] 1 error
----------------------------------------------------------------
If anyone can help I'ts greatly appreciated.
Thanks. [:)]
Eclipse/Ant Build "Failed Build"
This topic has been viewed 8577 times and has 4 replies
Re: Eclipse/Ant Build "Failed Build"
Forget about JAVA_HOME.
Here's my way to run Ant in Eclipse:
Here's my way to run Ant in Eclipse:
- select build.xml file in Sweet Home 3D project
- choose Run > External Tools > Run As > Ant Build... menu item
- in Edit Configuration dialog, select JRE tab
- click on Separate JRE radio button,
- click on Installed JREs... button,
- in Preferences (Filtered) dialog, click on Add... button
- in Add JRE dialog, select Standard VM, click on Next > button,
- click on Directory... button, and choose the directory of the JDK (not the JRE), probably C:\Program Files\Java\jdk1.6.0_17 under Windows,
- click on Finish, and click on OK in Preferences dialog,
- in Edit Configuration dialog, select jdk1.6.0_17 as separate JRE
- click on Run.
[/list=1]
Note that in Targets tab there are many different Ant targets. [;)]
Don't forget to create keys.keytool file first for javaWebStart, applet and viewer targets (see README.TXT file).
Emmanuel Puybaret, Sweet Home 3D creator
Re: Eclipse/Ant Build "Failed Build"
Hi and thanks for replying.
I tried your suggestions but nothing seems to make any diffenrence
\SweetHome3D\src\com\eteks\sweethome3d\applet\SweetHome3DApplet.java:231: annotations are not supported in -source 1.3
[javac] (use -source 5 or higher to enable annotations)
[javac] @SuppressWarnings("unchecked")
[javac] ^
[javac] 1 error
Related to this line
encoding="ISO-8859-1" target="1.1" source="1.2"/>
in the Build.xml file and this line:
@SuppressWarnings("unchecked")
in SweetHome3DApplet.java
Any other ideas?
Regards
I tried your suggestions but nothing seems to make any diffenrence
\SweetHome3D\src\com\eteks\sweethome3d\applet\SweetHome3DApplet.java:231: annotations are not supported in -source 1.3
[javac] (use -source 5 or higher to enable annotations)
[javac] @SuppressWarnings("unchecked")
[javac] ^
[javac] 1 error
Related to this line
encoding="ISO-8859-1" target="1.1" source="1.2"/>
in the Build.xml file and this line:
@SuppressWarnings("unchecked")
in SweetHome3DApplet.java
Any other ideas?
Regards
Re: Eclipse/Ant Build "Failed Build"
Don't be astonished if compilation fails: you must have added @SuppressWarnings("unchecked") annotation in SweetHome3DApplet.java and it's not supported in 1.2 source as reported in error message. Some times warnings are left on purpose...
As written in SweetHome3DApplet javadoc:
The bytecode of this class is Java 1.1 compatible to be able to notify users that it requires Java 5 when it's run under an old JVM.
and again in build.xml:
Compile Sweet Home 3D applets first with javac 1.1 to be able to detect current Java version during applet launch (otherwise Java 1.1 to 1.4 plug-ins refuse to load Applet class)
As written in SweetHome3DApplet javadoc:
The bytecode of this class is Java 1.1 compatible to be able to notify users that it requires Java 5 when it's run under an old JVM.
and again in build.xml:
Compile Sweet Home 3D applets first with javac 1.1 to be able to detect current Java version during applet launch (otherwise Java 1.1 to 1.4 plug-ins refuse to load Applet class)
Emmanuel Puybaret, Sweet Home 3D creator
Re: Eclipse/Ant Build "Failed Build"
Thanks.
I honelstly have absolutely no idea how I did that but I guess thats the result of too much messing around with the settings when trying to build.
Anyway, I reimported the source code and followed your instructions and... voila...build success.
You have done an impressive job and Im going to enjoy learning this
Thank you again.
I honelstly have absolutely no idea how I did that but I guess thats the result of too much messing around with the settings when trying to build.
Anyway, I reimported the source code and followed your instructions and... voila...build success.
You have done an impressive job and Im going to enjoy learning this
Thank you again.