Classpath config necessary for writing Java services?

I am trying to write my own Java service. When I hit the “Save” icon, the documentation tells me that the code should automatically compile. Instead, I receive an error that the compiler could not be found. I have installed the jdk on the same drive as the server, and included the path to the jdk on the system’s CLASSPATH variable. What else do I need to know to be able to compile my Java service?
Thanks in advance,
Rumana

I had the same problem, on Unix servers only.

When I use jcode from command prompt, I get the following error:
env[0]: ‘CLASSPATH=’
errors = java.lang.NoClassDefFoundError: com/sun/tools/javac/Main
Exception in thread “main”
C:\sapbc46\Server\bin>javac Services\CustomerMasterReplication.java
Exception in thread “main” java.lang.NoClassDefFoundError: com/sun/tools/javac/Main

I cannot directly compile my Java service b/c it was created as a .frag file, not a .java file.

Any ideas as to how to compile?

Thanks,
Rumana

It seems your JDK or the server.bat, jcode.bat was not set up properlly. Did you try javac.exe without a command line and see what happen?

There is no javac.exe with the webMethods installation. I was assuming this would be in the jre directory of webMethods, but it is not. So I downloaded the jdk separately onto the same drive, but jcode still doesn’t work. The javac.exe that I downloaded with the jdk does run alone, however.

I shouldn’t have had to download the jdk separately though right? The documentation made it seem as though webMethods server came with it’s own JRE to use.

Thanks,
Rumana

p.s. Whenever I try to “Save” my java service through the developer gui, I get the “Cannot locate compiler” error, with details of “Server error”

Make sure that you have the bin directory from the JDK on your PATH environment variable before launching the server.

If you are starting Integration server from start menu instead of command prompt, this will happen.
If you want to start it from start menu, right-click on IntegrationServer and in properties change the target to server.bat instead of .exe file.

Second thing you want to check is if there is another java process already running. Before starting the server take a look at processes. This is usually very big process. Kill it first and then start it.

I had the same problem last week. You need to modify your server.cnf file. Shutdown your server first so that it doesn’t overwrite your changes.
Modify the watt.server.compile setting in server.cnf. Restart your server.

Do a search on watt.server.compile or your error message to find more details.

Example:
watt.server.compile=C:\PROGRA~1\webMethods\IntegrationServer4\jvm\win.sun13\bin\javac -classpath {0};C:\PROGRA~1\webMethods\IntegrationServer4\jvm\win.sun13\jre\lib\rt.jar -d {1} {2}

On page 12 of the 4.6 IS Installation Guide:

[begin quote]
Integration Server comes with IBM JRE 1.3.0; you can use that JRE on Microsoft Windows systems.

The JVMs recommended in this table are for runtime only. If your system does not already have a Java compiler installed, you must install one.

IMPORTANT! Add the compiler to your system path before you start Integration Server.
[end quote]

While the recommendation to modify server.cnf will work, it is unnecessary. The install doc describes what you need to do.