JSweet is a Java to JavaScript transpiler that allows sharing code between client and server.
Questions tagged [jsweet]
19 questions
4
votes
1 answer
Installed jSweet. Now what?
I have a java project which I want to convert into Typescript (about 150 Files).
As per http://www.jsweet.org/getting-started/
...I checked out the jsweet Github project.
...I ran mvn generated-src
...I loaded index.html and it gave me 'It…

Oliver Watkins
- 12,575
- 33
- 119
- 225
4
votes
1 answer
Post Map as JSON using JSweet
I'd like to send a java.util.HashMap converted to JSON from the client to the server.
I'm using JSweet to transpile Java to JavaScript for the client side.
I had a look at XMLHttpRequest and tried to prepare the map for transfer using…

Matthias Braun
- 32,039
- 22
- 142
- 171
3
votes
1 answer
Can I write a cast operator in Typescript?
I've used JSWEET to transpile a large Java project. It has converted types like Enumeration

Mark Rabjohn
- 1,643
- 14
- 30
2
votes
2 answers
Can JSweet viably port Java libraries for use in cross-built Scala.js projects?
In the search for ways to make Java libraries accessible to both the JavaScript and JVM sides of Scala.js cross-built projects, please consider the following experiment:
Imagine that a Scala.js project needs advanced matrix math capabilities such as…

Ben McKenneby
- 481
- 4
- 15
2
votes
1 answer
Port Java module to JS with JSweet
I would like to convert these Java functions to JavaScript: CircleFitter.java. I don't need the file reading portions though.
JSweet seems like a good option. So, I tried pasting the contents of the java file into the online JSweet sandbox, but I…

Web_Designer
- 72,308
- 93
- 206
- 262
1
vote
0 answers
Jsweet library does not work in web application
I have tried transpiling java file to javascript file using jsweet library. It works when I executed via the main method of the java class. But the same code does not work when called via a web application hosted on tomcat. Is there any…

Omi A
- 65
- 8
1
vote
0 answers
Is it possible to use Jsweet source code Version (2.0.0) to customize JavaScript file
I am using maven and pom.xml to generate javascript from java class. In pom.xml
jsweet's dependency,repository is available there. when i build the project i am finding javascript file.
Now i need some modification during generation time of…

Bimal Kumar Dalei
- 196
- 5
- 14
1
vote
1 answer
Handling Java annotations in JSweet
I'm attempting to transpile Java model classes to JavaScript using JSweet. The model classes contain JPA annotations like @Column. The transpilation fails as soon as it encounters import javax.persistence.Column.
The JPA annotations are irrelevant…

warakawa
- 628
- 1
- 7
- 14
0
votes
0 answers
Use information of pojo attribute when generating typescript type
I use jsweet to generate a typescript file from a Pojo.
This is the simplified java class :
public class Menu {
public long id;
public String label;
@my.custom.annotation.Nullable
public List children;
}
It generates
/*…

jl-repson
- 1
- 2
0
votes
0 answers
Using jsweet candies together with the jsweet module 'commonjs' doesn't work: 'Cannot find name 'ArrayList'.'
I am currently trying to setup a gradle project using jsweet to automatically translate my java classes into typescript classes. I added the candy 'j4ts' so classes like 'ArrayList' for example are translated better in my typescript code. This works…

Puffel
- 23
- 3
0
votes
1 answer
What IDE can support Java-to-JavaScript along with Angular?
I'm trying to start a project that'll use Angular to build a web application and re-use/extend my existing (generic) Java code by automatically transpiling it into JavaScript when changes or additions are made.
JSweet seems like it'll be the best…

Brian White
- 8,332
- 2
- 43
- 67
0
votes
0 answers
Use jsweet to convert applet code to js with .class files dependencies
We have an application that is written in applet, so we are using jsweet to convert the code into js, the application has few files which only has .class files but no java files, it does not show any issue on compile time but when you run the…

Nikhil
- 1
- 2
0
votes
1 answer
Evaluating Jsweet for applet to HTML conversion
I have been evaluating Jsweet since the past 4 days in order to finalize a tool that can be used to modernize an application from applet to html5/js based front end. I have been able to try the trial examples where applet based java files are…

VSTech
- 77
- 3
- 11
0
votes
1 answer
Using JSweet to Transpile Java->JS, 'matches' error
I'm new to JS. I've written two large Java classes that I want to turn into JS using JSweet. The first smaller one transpiled without issue. With the second, I've hit a wall. It throws this error twice, and no others:
Line 55: property 'matches'…

Pumawesome
- 21
- 2
0
votes
1 answer
Transpile java library with JSweet and use it in angular
I just started to learn typescript. I was asked to transpile a java library with JSweet to embed it in an Angular project.
The java library contain only pure logic and do not depends from other library. The transpilaton go smooth and the result are…

Procedural World
- 1
- 1