codeapp
codeapp copied to clipboard
For multi-file programs, use javac command in the terminal to compile manually.
For multi-file programs, use javac command in the terminal to compile manually.
Originally posted by @bummoblizard in https://github.com/thebaselab/codeapp/issues/1028#issuecomment-1976423228
This still does not work, not even using javac. Tried everything at this point, please fix this.
Thanks for reminding me. I will fix this as soon as possible.
This will be fixed in 1.7.2, which is expected to release in a couple days.
Thanks looking forward.
@MTraveller @kvARCalsovonal07 @Sadasak The fix (1.7.2) is now available on the App Store. It should work right away without needing to use the command in the terminal.
@MTraveller @kvARCalsovonal07 @Sadasak The fix (1.7.2) is now available on the App Store. It should work right away without needing to use the command in the terminal.
Alright, did some testing and it works but not as expected.
If I press the play button in top right corner with the:
-test --Main.java --Test.java
it wont work as is. But if I compile first with javac and then run with java test.Main, it works, being inside the package in terminal.
The other method that seems to work as well is importing the Test.java class, as:
import test.Test;
Works with the top right play button.
Another thing I noticed, the && does not work when entered manually into the terminal.
@MTraveller , @bummoblizard
The key is to make sure that you are inside the directory at the terminal
For example, if the main class you are trying to run by the run button is in documents/project1/package1/ the terminal should look like this
package1 $
And if you are in documents/ it won't work
documents $
.
@MTraveller , @bummoblizard
The key is to make sure that you are inside the directory at the terminal
For example, if the main class you are trying to run by the run button is in documents/project1/package1/ the terminal should look like this
package1 $And if you are in documents/ it won't work
documents $.
True for import test.Test;
But not for package test;
I'll get a class error both with the button and running java test.Main or java Main.
Also for package test; being in parent folder of test works and not inside test.
If you are able to provide a sample would be great.
I have:
-javaplayground --textbox ---Main.java // Main. package textbox;
public class Main { public static void main(String[] args) { TextBox textBox1 = new TextBox(); textBox1.setText("Box 1");
System.out.println(textBox1.text);
}
}
---TextBox.java // TextBox.
package textbox;
public class TextBox { public String text = "";
public void setText(String text) {
this.text = text;
}
public void clear() {
text = "";
}
}
In terminal I am in javaplayground $ java textbox.Main which works otherwise nothing works, just errors.
@MTraveller
I think you have to be at textBox $ Try that if it doesn't work then screenshot the errors
Play button inside textbox:
java textbox.Main in parent folder:
@MTraveller I really don't know what's going wrong
It's running good with me
Found the issue. package textbox; is doing the mess up.