Java

 

XMLbeans scomp fails with “java.io.IOException: CreateProcess error=2, The system cannot find the file specified”

Beans Alubia pinta alavesa. Álava, Spain.
Image via Wikipedia

If you are using xmlbeans on Windows to bind your schema to Java types then you are probably using a tool bundled with the distribution called scomp or Schema Compiler. For schema compiler to work you will need to correctly setup computer environment by installing JDK. You can follow through the following check-list to detect if any additional installation steps are required on your machine setup:

  • Start->Run->type cmd and type java in the command line. If no error then your setup is correct; otherwise setup JAVA_HOME and add %JAVA_HOME%/bin to your Path environment variable and try again.
  • Start->Run->type cmd and type scomp in the command line. If no error then your setup is correct; otherwise setup XMLBEANS_HOME and add %XMLBEANS_HOME%/bin to your Path environment variable and try again.

Then run scomp. Depending on your wishes you will probably wan’t to create a .jar file of the Java types scomp compiles from schema files. I used the following command line:

scomp -d schema -src src -out my_schema_1_0_0.jar ./schema/mySchema.xsd

where mySchema.xsd file was stored in ./schema folder.

If you get my_schema_1_0_0.jar, by some coincidence then kudos to you, but most likely you will end up with something similar to this error:

Time to build schema type system: 1.282 seconds
Time to generate code: 18.687 seconds
java.io.IOException: Cannot run program "C:\your current path\javac": CreateProcess error=2, The system cannot find the file specified
java.io.IOException: CreateProcess error=2, The system cannot find the file specified
java.io.IOException: Cannot run program "C:\your current path\javac": CreateProcess error=2, The system cannot find the file specified
 at java.lang.ProcessBuilder.start(Unknown Source)
 at java.lang.Runtime.exec(Unknown Source)
 at java.lang.Runtime.exec(Unknown Source)
 ... 6 more
BUILD FAILED

Read on to solve this problem.

READ MORE

 

Sketchy musical factory

The Abstract Factory pattern illustration, UML...
Image via Wikipedia

Today we will take a look at the abstract factory design pattern. This design pattern continues the series of creational patterns.

In previous article we have talked about factory pattern. We have learned that factory pattern deals with creation of other objects. Now we will extend that knowledge with the abstract factory pattern which provides a way to group together or rather encapsulate a group of individual factories that create objects with common theme.

Normally we would code a client software to create a concrete implementation of the abstract factory and then use generic interfaces to create concrete objects that are tuned to specific theme but, the client does not know about which concrete object will it get from each of the internal factories since it uses generic interfaces of the factory product in question. Details of the implementation of concrete objects are hidden by the internal factories.

READ MORE

 

Eclipse Galileo and SVN support

Like many Java developers I had to take a look at Eclipse Galileo. My interest lie in how fast I can migrate from Eclipse Europa to new Galileo version.

Installation was as simple as in previous version. Extract an archive file to a directory. Simple eh ? Let’s see what will be broken. Upon first start Galileo tries to move my default workspace. Well I choose my old workspace and by some magic it was opened without problems. Or did it? Recompilation and reformatting took about a minute or two1. After that everything worked smoothly. Almost everything.  Project team collaboration vanished.

“GULP”, was my first reaction. CVS support is included, but who really uses CVS nowadays? So I found out that setting up SVN in Eclipse Galileo was not as simple as I thought it to be.

  1. Help->Install New Software
  2. Choose to work with Galileo – http://download.eclipse.org/releases/galileo
  3. Unfold Collaboration
  4. Choose Subversive SVN Team Provider (Incubation)
  5. I employ you to restart Eclipse and don’t use any plugin at this point since they will not work and you will get a message which is similar to this: 0x0040010b: Obtain Project Name’ operation finished with error: Selected SVN connector library is not available or cannot be loaded …’. Instead you rather install a connector library.
  6. Help->Install New Software
  7. Add a site
  8. I used: http://www.polarion.org/projects/subversive/download/eclipse/2.0/update-site/ , but you can probably use any other that has SVNKit or JavaHL connector
  9. Unfold Subversive SVN Connectors
  10. Select Subversive SVN Connectors, SVNKit (1.3.0), JavaHL (1.6.0) and it’s native libraries.
  11. Restart Eclipse
  12. Configure SVN Connector by specifying the connector in Window->Preferences->Team->SVN->SVN Connector.

And there you have it. Eclipse Galileo with SVN support in all its splendor.

Reblog this post [with Zemanta]
  1. it is a huge project tree I am working with []
 

Fungi Factory without abstraction

Next creational pattern that we will have a closer look at – is Factory pattern. There are at least two different Factory patterns, Factory method and Abstract Factory. In this installment we will be looking at the Factory method pattern.

READ MORE

 

Eclipse Code Assist / Code Completion / Content Assist hang-up

Do you use Eclipse ? Do you use Code Assist? You don’t ? You should :)

You will write your code much faster, and since you will be using CTRL + SPACE combination you will be heard in the office1

I use Eclipse daily and I must say that I am pleased with it. Until the content assist functionality hangs up. Then I am not as pleased as I could have been if it worked. I have to kill the Eclipse process and restart Eclipse or wait a minute or ten for the hang-up to end.

Now until today I couldn’t find the problem for that. As it happened some time ago I installed some plugins for Mylyn which in the process not knowingly changed some of the default setting in my Eclipse preferences. I don’t use Mylyn for task management. Changing the preferences to default values solved my problem.

So if Eclipse starts to hang up during usage of content assist check the:

Preferences->Java->Editor->Content Assist->Advanced section of Eclipse properties.

Enable Other Java Properties and Type Properties. If you are using templates in your code2 then enable Template Properties.

This should solve the problem with content assist hang-ups.

If they persist Documents as You Go has some interesting insight in Logitech Quickcam V10 application issues.

Reblog this post [with Zemanta]
  1. implying that you DO work ;) []
  2. like sysout []

Support Us