I have JDK8 installed in the directory C:\Program Files\Java\jdk1.8.0_05\ and I have my PATH Environment Variable set to C:\Program Files\Java\jdk1.8.0_05\bin.
Now; in order to use Amazon's Product API I follow their guidelines here under the Java getting set up section; and I use the following command...
wsimport -d ./build -s ./src -p com.ECS.client.jax http://webservices.amazon.com/AWSECommerceService/AWSECommerceService.wsdl -b jaxws-custom.xml
after opening a command prompt in a custom directory I created on my desktop; that custom directory contains the build and src directories as specified in the instructional page provided by Amazon.
Now when I run the command aforementioned; I receive the error...
'wsimport' is not recognized as an internal or external command
however; if I run Java -version within the same command prompt all works well and as expected.
Not sure where to go from here or why it isn't reading through?
Note I already attempted the solutions at this page; to no avail.
I found this in the comments section of the following article. I include it here in full because I think it explains why your JDK8/wsimport fails to build and consequently why it works when you switch back to Java7.
http://blog.takipi.com/6-reasons-not-to-switch-to-java-8-just-yet/
Even though the article was written over 3 years ago, I am still having java8/wsimport problems (2017).
Why not mention some more obvious ones:
The new defaults in Javadoc (called doclint) will break your build. In particular if you are using Maven and some kind of CI (e.g. Hudson,
Jenkins) you'll quickly realize that you can't just take your project
and build in JDK8. Your build will almost certainly error out because
of the new Javadoc. (I have yet to see a project that didn't). The
reason is that in Maven a return error code from the javadoc tool will
stop the whole release process ... and as I said I have yet to see a
project that would not somewhere have a Javadoc doclint noncompliance.
Most larger projects (e.g. Netty) seem to solve the problem by simply
turning off doclint (which of course wasn't the idea behind doclint)
or they stay on JDK7 for a while longer until they iron out all their
comments problems.
Code generation tools in JDK8 (e.g. wsimport) produce code that is not doclint compliant. This is a clear bug and well documented. It
means that one part of the JDK8 is not working with another part of
the JDK8. Expect to have to circumvent this somehow if you have a web
consumer application.
I am having a problem with Eclipse where I can run my program just fine, but when I try to start the debugger, I get this message
The picture is a little hard to make out, but instead of getting the normal debugging window, instead it says it is throwing a ClassNotFoundException, and is trying to dislay the source for Launcher$ExtClassLoader.
The thing that really baffles me though is that I can run the code just fine, it is only when I click the debug button that I have the problem.
I have also tried debugging at the command line with JDB, and I got the same error.
So far, I have tried Reinstalling Eclipse and downloading (what I believe to be) the correct Java Development tools for Mac OS X.
I have no idea what else I can try, so any help would be greatly appreciated. Let me know if there is any other information I can provide.
Source not found might be legitimate for dynamically loaded code (e.g. Maven).
There are three workarounds known to me (after months of search):
Connect to a running JVM with the debugger and you will see the code.
Use Dynamic Source Lookup plugin for Eclipse from here:
https://github.com/ifedorenko/com.ifedorenko.m2e.sourcelookup
Use run-jetty-run Maven plugin
http://code.google.com/p/run-jetty-run/
I prefer and recommend 3. It works and starts webapp much faster than jetty:run.
Unfortunately 2. didn't helped me as it has issues with Windows paths with spaces.
I have filled an enhancement request on Eclipse Bugzilla and if you agree this issue "Source not found" should vanish forever, please vote for it here:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=384065
Do you have the sources for the files that you are using. If you are using Maven (M2Eclipse) you could download the sources. This might solve the problem.
Otherwise you could go and manually attach your sources. Here is how you manually attach sources.
Next you have to attach the sources-
Hope this helps
The "source not found" is a red herring - there may simply be no way to get access to the source that is throwing the error, because it is deep in the guts of the debugger's class loader.
The better question, then, is, "Why is scottrice.ChessPuzzles.ChessPuzzleDriver not being found?" The only possibility that occurs to me at the moment is that something might be weird in your debug configuration. Did you debug the program by just right-clicking a file with a main() and choosing "Debug As" -> "Java Application"?
I'm in the process of porting simple console apps written in C++ to Java in order to show how similar the languages are, and how code can be ported. I've exported executable JARs for the programs using Eclipse. These JARs work fine when they are run using the java -jar command. However, they do not run properly when executed from windows explorer (double clicked). A console window simply opens and closes rapidly.
The only solution I have found thus far is to use a batch file. Is there any other option?
There are some options:
Sleep a bit when the program is done, so you can read the output.
Call System.in.read() (again at the end of the program), which will wait until you type a char and hits enter.
Create your own little swing terminal, which doesn't close when the application code is done.
This seems like the jre used from the command line and from the registry are not the same (this can occur when multiple JRE's are installed)
Have you checked in your windows registry what is the jre used to run the executable jars ?
You can find more on the registry settings on sun's site
Seems to me that your main class does not even gets executed.
This would explain the quick open/close of console window.
Or is it possible that another program than java has the "jar" file type?
Happened to me after installing a Nokia software.
Using a batch file seems to be my best option. I suppose that's why Eclipse has a launcher.
Change the open with program to
c:\Program files\java\jre7\bin\javaw.exe
I see reference of ant a lot but I don't get exactly what its meant to do? from what i've heard its supposed to compile your projects but can't i just do that by clicking Run->Run in eclipse?
Edit : I guess I should rephrase my question. I already know that ant is a 'build automation software', my question is, what exactly is build automation? I thought that you're supposed to test your app, and when it is running you click the 'build' button in eclipse or through command-line java, and it makes a .jar file out of it? So why do you need to 'automate' this process?
I already know that ant is a 'build automation software', my question is, what exactly is build automation? I thought that you're supposed to test your app, and when it is running you click the 'build' button in eclipse or through command-line java, and it makes a .jar file out of it? So why do you need to 'automate' this process?
Not all the Java development is done through eclipse and not all the jars may be built from the command line ( or should be built from the command line ) .
You may need additionally run test cases, unit tests, and many, many other process.
What ant does, is provide a mechanism to automate all this work ( so you don't have to do it every time ) and perhaps you may invoke this ant script each day at 6 p.m.
For instance, in some projects, a daily build is needed, the following are the task that may be automated with ant, so they can run without human intervention.
Connect to subversion server.
Download/update with the latest version
Compile the application
Run the test cases
Pack the application ( in jar, war, ear, or whatever )
Commit this build binaries to subversion.
Install the application in a remote server
Restart the server
Send an email with the summary of the job.
Of course for other projects this is overkill, but for some others is very helpful.
rogeriopvl is absolutely correct, but to answer your "can't I just do that by clicking Run->Run in Eclipse?" question: that's fine for a project that you're working on on your own, and don't need a repeatable, scriptable build in multiple environments.
If you're working on an open source project, however, or professional software which needs to be able to build on a build server etc, requiring a particular IDE to be running isn't a good idea.
Ant is used to automate a build process, but a build process is often much more than compiling. Ant has "tasks" that can be used to perform miscellaneous useful functions. You can create your own task to do just about anything by writing a java class and telling ant where to find it. You can then mix and match these tasks to create targets that will execute a set of tasks.
You can also set up a dynamic environment in which to build your application. You can set up property files to hold variables that can be used in the build process, i.e. to hold file paths, class paths, etc. This is useful for instance to differentiate between test and production builds where deployment paths, database instances, etc. might change. Ant also includes flow control (if, etc.)
Some things I've seen ant do:
Compile code
Use version control to checkout the latest version or to tag the version being built
Run sql scripts to build or rebuild a test database
Copy files from an external resource for inclusion in a project
Bundle code into a jar, war or ear file
Deploy a web application to an application server
Restart an application server
Execute a test suite
Static analysis, i.e. CheckStyle or PMD
Send email to a team to alert them to a build.
Generate files based on information from the build.
Example: I have a jsp in my app that does nothing but display version/build information. It is generated by ant when I run a build, and the production operations team checks this page when they deploy the application to make sure they've deployed the correct build.
In many larger companies (and likely some smaller ones), you'll find that production code is not built by the people who developed it. Instead, the developers may check their code into a source code repository and tag it. Then they give this tag to a build team.
The build team, in a separate (clean) area - possibly on some headless server (i.e. with no GUI) - will then check out the code and run a build script. The build script will be completely independent of the desktop environment/IDE.
This ensures that nothing which happens to be on any one developer's computer is "polluting" the build. (Or, more likely, nothing outside source control is required for the system to work!)
So most software you use will never, ever be built from a developer's desktop.
PS. You might also want to look at the idea of Continuous Integration
The short answer is that Ant is a great way to create a complete project build that is independent of any particular tool any developer may be using. Without an independent build, things can go haywire quickly - especially for large project teams.
And now for the long answer... I have been brought into several projects without any sense of an independent build. On one project, there was one guy who was not a developer that was tasked with building and deploying the software. He had created 147 separate windows batch files to compile each EJB, each servlet, and each client component. There was no error checking for this build. All log messages, including error messages went to standard out. It was up to him to manually recognize by reading this log which exception or message printed was a normal and which message was an error. He also had to deploy this software he just built. Deploying was equally as complex since there were several load-balanced tiers. Each module had to be placed in the right place manually with options setup to match downstream and upstream tiers. Building and deploying this software took him at least 3 days using this method. Of course, only then could anyone determine if the build "worked". Usually, after this period all the programmers would scramble to debug the build. Programmers would say my module works fine in my IDE. I just click run like this, see?
Indeed, the individual software modules usually worked, but the build and deployment was horribly ineffective. And just as bad, it was equally as difficult for anyone to deploy a build to more than one environment. Management would say, ok you now have this build working in our regression testing environment. Now deploy that same build in this other environment so the sales guys can demo up and coming software. That should be simple to do, but it also took at least 2 days, followed by a "debugging the build" period. Builds and deploys were never simple and never accurate. It really slowed the project down.
Anyway, we replaced this entire procedure with a complete Ant based build and deploy mechanism. The end result was that a complete build could be created and deployed in less than 30 minutes, completely automated. The QA guy managing the builds and deploys could keep a whiteboard of which environment had which build deployed to it and which group was using that environment. This was something that was just not possible with the old system.
Ant is for automating software build processes:
http://en.wikipedia.org/wiki/Apache_Ant
Ant allows CRISP (complete, repeatable, informative, schedulable, portable) builds. You can find great info on it in this presentation by Mike Clark and in his book, Pragmatic Project Automation.
Ant is a build tool, akin to makefiles (albeit with a very different syntax in XML). If you're only using Eclipse it's fine to stick to that and you can always convert an Ant build file into an Eclipse project (Eclipse's launch configurations are then, if I remember correctly, the equivalent of Ant's build targets).
If you want to deploy the source code of the application and allow others to easily build or set it up, automating that using Ant is probably not a bad idea. But it's usually not a consistent experience for users or at least I haven't seen much consensus on what targets should be there and doing what so far.
Ant may also be used for regular automated builds (you wouldn't want to hit Run in Eclipse every night, right? :-))
If there's one close to you I think you'd get a lot out of CITCON, the Continuous Integration and Testing Conference. You get to talk with lots of people about the benefits of automation applied to building and testing software.
Basically people use Ant (with other tools) to automate everything they want to have happen after a commit. The basic advantages of such automation are faster, better and cheaper.
Faster because things happen right away without waiting for a human to get around to it.
Better because computers are really really good at doing the same thing the same way every time. (Humans tend to suck at that.)
Cheaper because you have fewer mistake and the mistakes that occur are caught sooner and therefore cheaper to fix.
You are also referring to the ""Export ant buildfile".
If you write your own Ant script for building your application outside eclipse, you can write your own targets that use the Ant task to delegate to the generated build.xml.
Also, you can configure a project's 'builders' (project properties ยป Builders) to run any script (ant or otherwise) you want when you build the project, manually or automatically.
Joel (Spolsky) has a great article on "The Joel Test." Many of them revolve around being able to do important things often, quickly and reliably. One of those things is your build.
Eclipse is using ant for building, running, deploying, ...
"Ant is a Java-based build tool. In theory, it is kind of like Make, without Make's wrinkles and with the full portability of pure Java code." (from link text
Everything was going well. Nightly builds ran for more than a month with no problems. However, suddenly when invoking the feature builder from Eclipse the execution ends right away with the message.
ERRORLEVEL 13
As far as I know I haven't changed anything, as this computer is normally not touched. (It is only used for the nightly builds).
I've googled around to see what this error means but to no avail. I found a link from IBM that shows a custom bat file that catches this error, but the explanation given is not very useful.
My guess is that this is related to the workspace, somehow, or that the whole eclipse installation is corrupted.
Do you have any idea what this error means and how can it be corrected?
After reading what the error code means thanks to the answer from VonC I understood where to look. The problem was a lot more obscure that it seems.
I looked into the configuration folder for Eclipse (logs are either written there or in the .metadata folder when something goes wrong), and I found a huge log file. Inside the file I found the following error:
application org.eclipse.sdk not found
and the following exception, followed by a plugin name, several times:
java.util.zip.ZipException: Too many open files
Several plugins could not be loaded, causing a cascade of missing dependencies that prevented Eclipse from launching. I searched the web for this exception and found the following bug description from SUN, which says that Java 1.5.0 can not open more than 2,100 zip files.
The problem started a while after I installed the BABEL project translations for Eclipse into the build computer. These are more than 900 fragments, containing translations for many plugins, one for each language. As I installed it on top of an existing eclipse installation, it seemed that it was not a problem to open them.... until I cleared the workspace for the builds. Then Eclipse wouldn't launch anymore. I went over the limit. It didn't help that the first thing I tried to fix the build was, again.... clearing everything.
Because I only use this computer for headless builds, I didn't realize that the problem was in Eclipse itself and I was looking inside the build process. I only realized when I looked into the log file.
After installing Java 1.6.0_11 I was able to launch Eclipse and go on with my build.
It should mean "ant build failed", meaning the headless ant script fails at some point.
You should check if you can catch the log/output generated by this script to analyze this ant session and see at what point the ant script fails.
If it fails right away, it usually is because of:
a change in rights (writing access), or
in environment variable modifications, or
in resource access (path non accessible).
You also have to check if the computer is still in its original windows domain, and if the rights (admin ?) associated with the account running the ant script are still the same.