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



The information in this article applies to:

  • Microsoft Visual J++ 6.0
  • Microsoft Visual C# .NET (2002)
  • Microsoft Visual C# .NET (2003)
  • Microsoft Visual J++ 1.0

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 OutputDirectory do not have write permissions and the conversion process do not start.
Note: this error message is quoted verbatim and should appear as "... does not have ... and does not start."

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:
  1. Locate the JConverter.exe file in the following folder: C:\Program Files\Microsoft Visual Studio .NET\JavaLanguageConversionAssistant
  2. Run the following command:

    Microsoft Visual Studio .NET Setup Dir\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.

STATUS

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

MORE INFORMATION

Steps to Reproduce the Behavior

  1. Under C:\, create a new folder that is named JavaFiles.
  2. 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;
    	}
    }
    
  3. Save the file as C:\JavaFiles\Customer.java.
  4. 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;
    	}
    }
  5. Save the file as C:\JavaFiles\Employee.java.
  6. Locate the JConverter.exe file in the following folder:

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

  7. Run the following command:

    Microsoft Visual Studio .NET Setup Dir\JavaLanguageConversionAssistant\JConverter C:\JavaFiles\*.java /Verbose

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 "Symptoms" section of this article.

REFERENCES

For more information about the Java Language Conversion Assistant (JLCA), visit the following MSDN Web site:

Modification Type:MinorLast Reviewed:1/13/2006
Keywords:kbBug kbCodeGen kbCommandLine kbJava kbconvert KB819603 kbAudDeveloper