Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 272465

Summary: [jar exporter] DBCS3.5: Runnable JAR file can not find class names wiith non-ascii characters
Product: [Eclipse Project] JDT Reporter: Masaihko Maedera <maedera>
Component: UIAssignee: Dani Megert <daniel_megert>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: camle, daniel_megert, darin.eclipse, ferenc.hechler, kitlo, Olivier_Thomann, pwebster
Version: 3.5   
Target Milestone: 3.5 M7   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Eclipse Project Archive(DBCSRunnable_JAR_Test.zip)
none
create JAR file
none
java -jar dbcsRun.jar none

Description Masaihko Maedera CLA 2009-04-16 05:25:00 EDT
Created attachment 132058 [details]
Eclipse Project Archive(DBCSRunnable_JAR_Test.zip)

Build ID: I20090313-0100

Steps To Reproduce:
1.Import DBCSRunnableJAR_Test.zip attached to this report.
2.Verify DBCS\u3042.class can run correctly.
3.Create Runnable JAR file, for example, ascii.jar in the dialog through [Export] > [Java] > [Runnable JAR file] to choose DBCS\u3024.class as the launch entry.
4.Open a system console, then type "java -jar ascii.jar".
5.The following messages are shown in the console.

Exception in thread "main" java.lang.ClassNotFoundException: dbcs.DBCS\u3042
        at java.lang.Class.forName(Class.java:169)
        at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:54)


More information:
OS: Microsoft Windows XP, SP2
OS: SUSE Linux 11
JRE: IBM JRE 1.6.0
Comment 1 Olivier Thomann CLA 2009-04-17 13:31:41 EDT
Moving to JDT/Debug
Comment 2 Darin Wright CLA 2009-04-17 13:39:06 EDT
Jar export is owned by JUI.
Comment 3 Dani Megert CLA 2009-04-20 04:49:57 EDT
>1.Import DBCSRunnableJAR_Test.zip attached to this report.
>2.Verify DBCS\u3042.class can run correctly.

Masaihko, when I import the attached project I get compile errors on the file (tried UTF-8).
Comment 4 Masaihko Maedera CLA 2009-04-21 04:57:28 EDT
Sorry for my late response.
Could you change the file encoding into MS932?
This is the default encoding by Eclipse under Japanese Windows XP/2008.
Most of the developers will use it without customization.

This is the same case for the other DBCS languages, such as Chinese, Korean.
Comment 5 Dani Megert CLA 2009-04-21 09:40:13 EDT
OK, I switched to MS and it compiles. However, when I try this step:
>2.Verify DBCS\u3042.class can run correctly.

Unfortunately I cannot reproduce this step because on my machine the DOS cmd does not support MS932 code page, however, I can create a Runnable (or normal) JAR and it works like a charm (see attached JAR file).

- please try the JAR file I attached - does it work?
  (make sure to use: java -Dfile.encoding=MS932 -jar run3.jar)
- please try with your example again and don't forget to pass the encoding as
  shown in previous step
- if it still doesn't work please attach your example workspace and the created 
  JAR here
Comment 6 Dani Megert CLA 2009-04-21 09:41:19 EDT
Created attachment 132605 [details]
create JAR file
Comment 7 Masaihko Maedera CLA 2009-04-23 05:35:43 EDT
Created attachment 132908 [details]
java -jar dbcsRun.jar

Hi Dani,

I attached the problematic JAR file.
I forgot the most important information.

When you export a Runnable JAR file ( > Export > Java > Runnable JAR file), please check "Package required libraries into generated JAR" in the dialog.

This option may not be necessary for such a simple JAR.
But I found this problem, when I tested the more complex JAR file which includes many JAR files as the dependent libraries.
Comment 8 Dani Megert CLA 2009-04-23 08:18:47 EDT
Fixed in HEAD.
Available in builds > N20090422-2000.
Comment 9 Dani Megert CLA 2009-04-23 08:26:56 EDT
Note that this was not just a DBCS issue: any main class with a non-ASCII character (e.g. รถ) didn't work.
Comment 10 Masaihko Maedera CLA 2009-05-08 00:24:11 EDT
I verified this bug had been fixed on the following builds.
- Eclipse-SDK-3.5M7-win32.zip (I20090430-2300)
- Eclipse-SDK-3.5M7-linux-gkt.tar.tz (I20090430-2300)

Thank you for you fix.
I will close this bug report.
Comment 11 Masaihko Maedera CLA 2009-05-08 00:25:44 EDT
I close this bug report. Thank you.