|
| 1 | +SwingJS distribution README.txt |
| 2 | + |
| 3 | +SwingJS has been successfully tested in Eclipse Neon and Oxygen on Mac and Windows platforms. |
| 4 | +(No reason to believe it would not also work for Linux; just haven't tried that recently.) |
| 5 | + |
| 6 | +INSTALLATION INSTRUCTIONS |
| 7 | + |
| 8 | +Eclipse Neon or higher is necessary. |
| 9 | + |
| 10 | +1. net.sf.j2s.core_3.1.1.jar should be copied to the eclipse/dropins |
| 11 | +directory **AS net.sf.j2s.core.jar dropping the version info** |
| 12 | +because otherwise Eclipse will not recognize an update. |
| 13 | + |
| 14 | +We do not know why this is necessary, but it appears to be. If you leave |
| 15 | +the version in the name, Eclipse will not be able to replace it with a |
| 16 | +newer version later. From what we can tell. |
| 17 | + |
| 18 | +On Mac systems, this directory is |
| 19 | + |
| 20 | +/Applications/Eclipse.app/Contents/Eclipse/dropins |
| 21 | + |
| 22 | +2. restart Eclipse and check for the presence of the plug-in at |
| 23 | + help...about Eclipse...installation details...Plug-ins...(wait several seconds for tabulation) |
| 24 | + |
| 25 | +search for "j2s" to find j2s.sourceforge.net Java2Script Core |
| 26 | + |
| 27 | +If that is not there, you don't have net.sf.j2s.core.jar in the proper directory. |
| 28 | + |
| 29 | +3. Create an Eclipse Java project for your work, if you have not done so already. |
| 30 | +If your source code is not all already in src/, navigate to the project...properties...Java Build Path...source |
| 31 | +and add all the source directories you need. |
| 32 | + |
| 33 | +4. Create in the Eclipse project the file: |
| 34 | + |
| 35 | +.j2s |
| 36 | + |
| 37 | +containing simply: |
| 38 | + |
| 39 | +j2s.compiler.status=enable |
| 40 | + |
| 41 | +5. Modify the .project file to indicate the j2s transpiler is to be used, |
| 42 | +changing the buildSpec buildCommand from |
| 43 | + |
| 44 | +org.eclipse.jdt.core.javabuilder |
| 45 | + |
| 46 | +to |
| 47 | + |
| 48 | +net.sf.j2s.core.java2scriptbuilder |
| 49 | + |
| 50 | +6. All of the JavaScript produced will be in the project site/ directory. |
| 51 | +You must prepopulate this site with all the JavaScript required by the |
| 52 | +JavaScript version of the JVM. The most recent version of site/ is at |
| 53 | + |
| 54 | +https://github.com/BobHanson/java2script/blob/master/sources/net.sf.j2s.java.core/SwingJS-site.zip?raw=true |
| 55 | + |
| 56 | +Occasional additions to the java.* classes are made to the above-mentioned zip file. |
| 57 | + |
| 58 | +If you find you are missing a class, please contact me (Bob Hanson) at hansonr@stolaf.edu. |
| 59 | +You can try adding these yourself by **temporarily** adding one or more of the |
| 60 | +Java classes found at http://grepcode.com to the proper package. If you do that, be sure |
| 61 | +to use the OpenJDK version. Most of the code in the SwingJS project started with Java 6-b14 or 6-b27. |
| 62 | +Build your project, then delete these Java files, because you do not necessarily want your Java |
| 63 | +code using that version, just JavaScript. |
| 64 | + |
| 65 | +A full site with many examples is at https://chemapps.stolaf.edu/swingjs/site |
| 66 | + |
| 67 | +VARNA development is at https://github.com/BobHanson/VARNA |
| 68 | +working site is https://chemapps.stolaf.edu/swingjs/varna |
| 69 | + |
| 70 | +Physlets development is at https://github.com/BobHanson/Physlets-SwingJS |
| 71 | +working site is https://chemapps.stolaf.edu/swingjs/physlets |
| 72 | + |
| 73 | +As of Feb. 17, 2018, we are actively converting a variety of functioning Java applets. |
| 74 | + |
| 75 | +The physlets Animator, Doppler, and Optics are working. |
| 76 | + |
| 77 | +As of Jan. 2, 2018, all known Java-to-JavaScript issues have been dealt with. |
| 78 | +Efficient Google Closure Compiler compression is in place. |
| 79 | + |
| 80 | +As of Dec. 17, 2017, SwingJS is fully operational in its "version 2" format, |
| 81 | +which includes fully qualified method, array, and number typing. |
| 82 | + |
0 commit comments