Microsoft KB Archive/819603

= BUG: JLCA command-line utility does not convert multiple Java files in one try =

Article ID: 819603

Article Last Modified on 5/16/2007

-

APPLIES TO


 * Microsoft Visual J++ 6.0 Standard Edition
 * Microsoft Visual C# .NET 2002 Standard Edition
 * Microsoft Visual C# .NET 2003 Standard Edition
 * Microsoft Visual J++ 1.0 Standard Edition

-





SYMPTOMS
When you try to convert multiple Java-language files by using the Java Language Conversion Assistant (JLCA) command line utility, JConvert.exe, all the Java-language files are not converted.

The symptoms you experience vary according to which version of JLCA is installed on your computer:  JLCA 1.0 Beta2 installed on Microsoft Visual Studio .NET 2002: only the first Java-language file in lexical order is converted. JLCA 1.0 included with Microsoft Visual Studio .NET 2003: no Java-language file is converted to Microsoft Visual C# .NET code, and you receive the following error message:

The output path  do not have write permissions and the conversion process do not start.



Note: this error message is quoted verbatim and should appear as &quot;... does not have ... and does not start.&quot;



CAUSE
JLCA command line utility does not support converting multiple Java-language files in one attempt.



WORKAROUND
To work around this problem, use the inputDirectory command line option of the JConvert.exe executable. Using the inputDirectory option, you can convert all your Java-language files in the input directory to Visual C# .NET code.

To use the inputDirectory option of JConvert.exe, follow these steps:  Locate the JConverter.exe file in the following folder: C:\Program Files\Microsoft Visual Studio .NET\JavaLanguageConversionAssistant Run the following command:

 \JavaLanguageConversionAssistant\JConverter C:\JavaFiles\ /Verbose

To open a command prompt, click Start, click Run, type cmd, and then click OK.



In the C:\JavaFiles\OutDir folder, you see listed the corresponding Visual C# .NET code for all the Java-language files in the C:\JavaFiles directory. You do not see listed the inputDirectory command line option description for JConvert.exe when JLCA is installed on Visual Studio .NET 2002.

<div class="status_section">

STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

<div class="moreinformation_section">

Steps to Reproduce the Behavior
 Under C:\, create a new folder that is named JavaFiles.</li>  Open a text editor, such as Notepad, and then paste the following code: public class Customer {   public String name; public int customerId; Customer(String name, int id) {       this.name = name; this.customerId = id; } } </li> Save the file as C:\JavaFiles\Customer.java.</li>  On the File menu, click New, and then add the following code to the file: public class Employee {   public String name; public int empId; Employee(String name, int id) {       this.name = name; this.empId = id; } } </li> Save the file as C:\JavaFiles\Employee.java.</li> Locate the JConverter.exe file in the following folder:

C:\Program Files\Microsoft Visual Studio .NET\JavaLanguageConversionAssistant

</li> Run the following command:

 \JavaLanguageConversionAssistant\JConverter C:\JavaFiles\*.java /Verbose

</li></ol>

When you use JLCA 1.0 Beta2 on Visual Studio .NET 2002, the corresponding Visual C# .NET code for only Customer.java appears listed in the C:\JavaFiles\OutDir folder.

When you use JLCA 1.0 that is included in Visual Studio .NET 2003, you receive the error message that is mentioned in the &quot;Symptoms&quot; section of this article.

<div class="references_section">