Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 355146 - Need an equivalent fda7.jar to be on the java build path to execute java generated code
Summary: Need an equivalent fda7.jar to be on the java build path to execute java gene...
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Matt Heitz CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 355440 356410 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-08-18 14:48 EDT by Jing Qian CLA
Modified: 2017-02-23 14:17 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jing Qian CLA 2011-08-18 14:48:53 EDT
in EDT, if I create a basic EGL Project, and uses java generator, there is no java runtime included for me. 

I have to check out the java.runtime project from eclipse cvs and set the java build path to depends on the runtime project. 

We need to configure this for the end user automatically, like in RBD, we have the equivalent of fda7.jar, which is set on user's project java build path automatically upon creation or generation.
Comment 1 Matt Heitz CLA 2011-08-18 15:02:43 EDT
Jing, I can't reproduce this.  When Java is generated, a library called "Java runtime" is added to the project's Java build path.  That's not an EGL library, it's a Java classpath library.

You can also add it manually on the Java build path properties page.  Go to the Libraries tab and click Add Library.  The one you want is EDT Runtime.

What we *do* need is a way for people to get a jar containing the runtime, so people can run generated code outside of the workbench.
Comment 2 Kathy Carroll CLA 2011-08-18 15:11:04 EDT
Try running this program

program tester type BasicProgram {}
	
	today date;
	
	function main()
		syslib.writestdout("Hey " + today);
	end
	
end

Fails when I don't explicitly add org.eclipse.edt.runtime.java to my Java Build Path Projects
Comment 3 Will Smythe CLA 2011-08-18 15:15:45 EDT
I posed a similar-ish question related to when the user creates a new EGL project, selects the Basic template, and picks the JavaScript generator: do we just configure the project to use the JavaScript generator OR should we do additional configuration to the project (e.g. create a WebContent folder, etc). I think not. 

It does seem like there needs to be some type of configuration that happens on a project when a generator is associated with it -- and it seems this should be controlled by whatever actually contributed the generator into the IDE. This way, whenever a generator is associated with a project (whether when it's created or via the Properties dialog later, the project is properly configured).
Comment 4 Matt Heitz CLA 2011-08-18 15:22:04 EDT
I made a new project in a new workspace and put Kathy's program into it.  No problems.

Are there any error messages in your log?
Comment 5 Kathy Carroll CLA 2011-08-18 16:32:32 EDT
Nothing in the log file.

Console content:
Exception in thread "main" java.lang.NoClassDefFoundError: com/ibm/icu/util/Calendar
	at org.eclipse.edt.runtime.java.egl.lang.EDate.defaultValue(EDate.java:65)
	at example.tester.ezeInitialize(tester.java:28)
	at example.tester.<init>(tester.java:25)
	at example.tester.main(tester.java:20)
Caused by: java.lang.ClassNotFoundException: com.ibm.icu.util.Calendar
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClassInternal(Unknown Source)
	... 4 more
Comment 6 Matt Heitz CLA 2011-08-18 16:54:50 EDT
I do see the same problem when I run the code.  I didn't try running until now because the initial bug report says the runtime is missing and it didn't include that error message.  You actually do have the runtime.  What's missing is the ICU4J library, which the Java runtime depends on.

You can work around this by manually adding the ICU4J jar to your project's Java build path.  On the Libraries tab, click Add External Jars, and go to the eclipse\plugins\ directory of your Eclipse installation.  Pick the jar named com.ibm.icu_4.2.1v20100412.jar.  If you have a different version of Eclipse than me, the numbers in the jar's name will be different.  That's OK.
Comment 7 Jing Qian CLA 2011-08-18 17:16:58 EDT
I think the point of this defect to say we need to do something in our configuration so that end user doesn't have to do any manual configuration in order to execute the generated java.

for now, we use the manual steps I described initially to get by.

I agree with Will's post, I think whenever the generator is chosen, we should setup the runtime configuration as well (both java and javascript, whatever that might be)
Comment 8 Matt Heitz CLA 2011-08-18 17:25:01 EDT
I agree.
Comment 9 Will Smythe CLA 2011-08-18 22:50:28 EDT
Can we come up with a more descriptive name for "fda7.jar"? Maybe "egljavart.jar"? 

What does "fda" stand for anyway?
Comment 10 Matt Heitz CLA 2011-08-19 09:29:19 EDT
I agree with you Will.  We'll be sure to give it a decent name.

FDA was the three-letter product code for the Java runtime in VAGen.  A handful of other jar files and classes in RBD still have names based on those codes (CSO, HPT, WGS).
Comment 11 Matt Heitz CLA 2011-08-19 11:46:34 EDT
Figuring out how/if to include ICU4J will be part of this work.  Users might have to download it separately.
Comment 12 Matt Heitz CLA 2011-08-23 09:14:19 EDT
*** Bug 355440 has been marked as a duplicate of this bug. ***
Comment 13 Matt Heitz CLA 2011-08-31 11:19:09 EDT
Decisions!

1. We'll produce a runtime jar during the build which contains the Java runtime and ICU4J.  The name of the jar will be egljavart.jar.

2. The runtime jar will be added to the Java Build Path of EGL projects, instead of the runtime plugin which is what you get at the moment.  The runtime plugin doesn't give you ICU4J.

3. The runtime jar can be exported by users so they can compile and run code outside of Eclipse.

4. For extensibility, the name and location of the runtime jar has to be something specified by the generator.  This is an enhancement for a future release, captured in Bug 356357 - Need a way to specify the Java runtime jar.
Comment 14 Matt Heitz CLA 2011-08-31 17:04:19 EDT
*** Bug 356410 has been marked as a duplicate of this bug. ***
Comment 15 Matt Heitz CLA 2011-09-02 10:24:58 EDT
I'm going to revise the decisions from comment 13.

1. The runtime jar will be the runtime plugin jar itself (org.eclipse.edt.runtime.java_0000000.jar).  We'll insert the ICU4J classes during the build.  The previous idea called for a separate jar to be created, but users needing it outside of Eclipse would be forced to dig it out from inside the plugin.  That's too awkward.

2. The runtime jar will be added to the Java Build Path of EGL projects.  Developers who have org.eclipse.edt.runtime.java in their local workspace will have to manually add the ICU4J jar to the Java Build Path, because those classes aren't stored in CVS.

3. The enhancement in Bug 356357 still applies.
Comment 16 Matt Heitz CLA 2011-09-02 11:38:29 EDT
It looks like ICU4J was successfully inserted into the runtime plugin during the most recent build.  The date/time stuff should work now without any additional setup for people with EDT installed.
Comment 17 Matt Heitz CLA 2011-09-27 10:16:51 EDT
Closing all JavaGen enhancements that are in the Resolved state.