Java2Script on Eclipse 3.x & 4.x

645 views
Skip to first unread message

Zhou Renjian

unread,
Oct 3, 2013, 10:18:21 AM10/3/13
to java2...@googlegroups.com
Hi All,


Even though the above Java2Script builds is not well tested, they have lots of bug-fixes and should work on later versions of Eclipse ( J2S-eclipse-v4.3 should works on later 4.4+, if no big JDT API chagnes ).

Sorry for the long waiting. If there are no big problems in the next or next two months, I will update these builds to http://j2s.sourceforge.net/ or https://code.google.com/p/java2script/ .

Regards,
Zhou Renjian

robert....@twc.com

unread,
Oct 8, 2013, 10:26:06 AM10/8/13
to java2...@googlegroups.com
Hello,

Thank you for posting these new builds.  I am using Eclipse 4.3 on MacOS 10.7.5.  I installed the appropriate version of Java2Script, and when I go to Eclipse -> About Eclipse -> Installation Details -> Plugins, I see four "net.sf.j2s.*" plug-ins.  Yet, when I open the Properties page of my Java applet project, I do not see the Java2Script builder.  I've included a screen shot of the Properties page below.  Any advice on what I am doing wrong?  (This may be irrelevant information, but the installation instructions refer to a j2s/features folder, but there is no such folder, only a text file called features.txt that appears only to contain documentation.)

-- Bob Grossman


Zhou Renjian

unread,
Oct 8, 2013, 12:46:48 PM10/8/13
to Java2Script
J2S recognizes Java project only, and it will replace javabuilder with java2scriptbuilder. For example, .project file would be:

<?xml version="1.0" encoding="UTF-8"?>

<projectDescription>

<name>test.j2s</name>

<comment></comment>

<projects>

</projects>

<buildSpec>

<buildCommand>

<name>net.sf.j2s.core.java2scriptbuilder</name>

<arguments>

</arguments>

</buildCommand>

</buildSpec>

<natures>

<nature>org.eclipse.jdt.core.javanature</nature>

</natures>

</projectDescription>

If you want to enable java2scriptbuilder for your Applet project, try to modify .project to see if it works or not.


Regards,
Zhou Renjian


--
You received this message because you are subscribed to the Google Groups "Java2Script" group.
To unsubscribe from this group and stop receiving emails from it, send an email to java2script...@googlegroups.com.
To post to this group, send email to java2...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/java2script/6622b44f-b09e-4696-a66b-b419f1882a7e%40googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

robert....@twc.com

unread,
Oct 8, 2013, 2:30:02 PM10/8/13
to java2...@googlegroups.com
I did as you suggested -- changed the .project file manually.  Now I see Java2Script listed under Builders.  I do not see any place to enable the builder, as your "getting started" instructions show.  However, I can now use the project's contextual menu to go to Run As -> Java2Script Application, a new window opens, which I show below. I have no idea what to do now.


Zhou Renjian

unread,
Oct 9, 2013, 2:03:36 AM10/9/13
to Java2Script
It need main() method to run as Java2Script application.

I suggest that you start using Java2Script from normal Java application with main() method. Directly moving into Applet project is not a good point.

Regards,
Zhou Renjian


On Wed, Oct 9, 2013 at 2:30 AM, <robert....@twc.com> wrote:
I did as you suggested -- changed the .project file manually.  Now I see Java2Script listed under Builders.  I do not see any place to enable the builder, as your "getting started" instructions show.  However, I can now use the project's contextual menu to go to Run As -> Java2Script Application, a new window opens, which I show below. I have no idea what to do now.


--
You received this message because you are subscribed to the Google Groups "Java2Script" group.
To unsubscribe from this group and stop receiving emails from it, send an email to java2script...@googlegroups.com.
To post to this group, send email to java2...@googlegroups.com.

Zhou Renjian

unread,
Oct 17, 2013, 5:12:03 AM10/17/13
to Java2Script

Zhou Renjian

unread,
Oct 18, 2013, 11:56:13 PM10/18/13
to Java2Script

temp temp

unread,
Apr 20, 2014, 9:08:20 PM4/20/14
to java2...@googlegroups.com
Hello,

We downloaded v20131019 version, but cannot find the Java source code.
Does this version open source ?
Thanks.

Zhou Renjian於 2013年10月3日星期四UTC+8下午10時18分21秒寫道:

Zhou Renjian

unread,
Apr 22, 2014, 11:58:25 PM4/22/14
to java2...@googlegroups.com
Hi,

It seems that I forgot to submit those updates or new projects to SVN. I was trying to split project net.sf.j2s.core into to two project at the time Oct, 2013 before submitting all Eclipse 3.x & 4.x to SVN. But I did not finish the job and moved to other things.

Here are the sources:


Each zip file contains two projects: net.sf.j2s.core and net.sf.j2s.ui , which are depended on different versions of Eclipse SDK. The other projects are independent of Eclipse SDK and can be downloaded from SVN of Google Code.

BTW: The Eclipse 3.6 is missing because its project is already split and not matching with the build.

Udo

unread,
Oct 8, 2014, 5:46:12 PM10/8/14
to java2...@googlegroups.com
Hi,

is there any chance to get a version of Java2Script for the latest version of Eclipse (4.4, "Luna", released in June 2014)?

Thanks,

Udo

Zhou Renjian

unread,
Oct 12, 2014, 10:00:23 AM10/12/14
to Java2Script
Hi Udo,

Here is the build for 4.4:


and the sources for 4.4:


Only a few lines are changed at net.sf.j2s.core.builder.JavaBuilder, comparing to J2S for Eclipse 4.3.


Regards,
Zhou Renjian

--
You received this message because you are subscribed to the Google Groups "Java2Script" group.
To unsubscribe from this group and stop receiving emails from it, send an email to java2script...@googlegroups.com.
To post to this group, send email to java2...@googlegroups.com.
Message has been deleted

Ogi Stefanova

unread,
Sep 30, 2017, 11:02:45 AM9/30/17
to Java2Script
Hello Zhou Renjian,

thank you very much for the j2s plugins. Could I please ask you for help on a issue I get. I have separate projects which I would like to link to the main one, so in eclipse in JavaBuild Path I have added the Projects, the same I did in the Java2Script Builder and when I run the application as Java2Script application I get the following error:


An internal error occurred during: "Launching MovilizerClientMain (1)".

java.lang.NullPointerException



If I remove the projects from the JAva2Script Builder I no longer get the above error, but then in the console it is reporting it cannot find the js files - which are in the other projects
Can you please help me with this?

Thank you
Best Regards
Ognyana

Zhou Renjian

unread,
Sep 30, 2017, 11:33:01 AM9/30/17
to Java2Script
Hi Ogi Stefanova,

I suggest you to open *.html to check if generated class path for *.js in your referenced project is correct or not. For example
window["j2s.lib"] = {
base : "../../../Applications/Eclipse.app/Contents/Eclipse/plugins/net.sf.j2s.lib_2.0.0/",
/*alias : "2.0.0",*/
alias : "j2slib",
version : "20081203",
/*forward : true,*/
mode : "dailybuild",
onload : function () {
var j2sBase = window["j2s.lib"].j2sBase;
ClazzLoader.packageClasspath ("java", j2sBase, true);
ClazzLoader.setPrimaryFolder ("bin");
ClazzLoader.packageClasspath ("j2s.test1", "bin/");
ClazzLoader.packageClasspath ("j2s.test2", "../j2s.test2/bin/");
ClazzLoader.loadClass ("j2s.test1.TestA", function () {
j2s.test1.TestA.main([]);
});
}
};
See "ClazzLoader.packageClasspath" in the above scripts.

Sometimes, if two projects contain same package name, the package classpath will be incorrect. You may need to merge project yourself or copy *.js into one folder.

If java.lang.NullException is printed out in browser, you need to locate the exception point. Converted JavaScript may be exactly the same of Java code. 

Bob and Udo, who are also in this group, are developing next version of Java2Script these days, making big performance improvement and adding other language features. Keep tuned for their great progress.

Regards,
Zhou Renjian


Regards,
Zhou Renjian

To unsubscribe from this group and stop receiving emails from it, send an email to java2script+unsubscribe@googlegroups.com.

To post to this group, send email to java2...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages