Error geany_run_script exit using mac - java

I'm new to programming in Java and just installed granny and Java dk.
If i'm compiling any file i'll always get this error:
Denniss-MacBook-Pro:~ Dennis$ /var/folders/91/09mjkvzn627b2vf7gb6tcvcr0000gn/T/geany_run_script_AJUY6X.sh ; exit;
(program exited with code: 0)
Press return to continue
I've got no ideas how to fix this problem.
Hope somebody can help me.

This ist actually not a bug or an issue on your code. MacOS is just not closing the terminal your application has been executed in.
You can go to Edit->Preferences->Terminal and activate "Execute programs in the VTE". This will cause Geany to run your tool inside the little terminal on the bottom of Geany. You can also activate "Don't use run script" so Geany will not generate the little shell script around your application to run.

Related

Vs code terminal issue

When I tried to run java code in visual studio code, the terminal is throwing an error
PowerShell terminated with exit code:4294901760
I have searched all queries but nothing is relatable.
You need to install java in VS-Code. To do so you can just search "java" in the extensions search bar. after that you will see an extension called "Java Extension Pack", install it and then you issue will hopefully be fixed
Thank you, I tried this, actual issue was windows power shell, unchecked run engine of powershell from windows features -->programs-->control panel. Then restarted the pc after then my powershell opened and same worked.

JAVA : Program Works in Terminal , But not in Visual Studio Code : Mac OS

My JAVA Programs used to run without any errors on both the Terminal and Visual Studio Code's Terminal .
After my Mac updated to MacOs Big Sur Version 11.0.1 , my JAVA programs show an error , even though the same code worked properly before .
There was no error before.
I checked my JDK and JRE Installations also
My Python files execute normally in the VS Code environment , so I do not think there is a problem with VS Code .
I have tried searching for an solution and have tried to clear the logs.
I would appreciate if anyone could guide me :)
Run the .java file in Terminal to check if JDK can work normally:
javac Hey.java
java Hey
If there's nothing wrong with the above command execution, turn to VS Code, uninstall Java Extension Pack and also delete the related folders under User/name/.vscode/extensions, then reinstall it again;
Set java.home and java.configuration.runtimes in User Settings.json.
Reference: Configure JDK.
Then run the project again to see if the problem goes away.
Install Java by searching for extensions in VSCode and try to run again.It will be executed. I belive it is not installed
You need to install the java plugin in VS Code.
Hi just found a solution here!
Initially guess it should be a problem with zsh.
so first open your terminal and type
open ~/.zshrc
at this point you will see text editor pops up with a zsh config file.
Add
export JAVA_HOME=`/usr/libexec/java_home
to the last line in that file, and save the file quit.
Then just reopen the VSC and you will notice everything would back to normal as usual.
I faced a similar problem. When running the same Java program, it worked in terminal but VS Code couldn't detect java.
All it turned out to be was I forgot to add Code itself to Path after reinstallation, nothing to do with Java.

eclipse terminates programs without an error

Eclipse has begun terminating any program I try to run before it does anything. The only output is 4.12 printed to the console. It's not just one program with errors, I've tried running old programs that I know worked before but they all exit with 4.12 being printed out.
I tried downloading a new version of eclipse (Mars.1 Release (4.5.1)) but it hasn't really done anything. In the old version it was exiting everything with the code 4.11 so I've run out of ideas to get this to work again.
EDIT
I'm on a mac, using 64-bit.
None of my programs run, I haven't just been leaving the main() empty.
I tried running from the command line and all my programs have changed type from .java to .class
The error I got in the command line was
Class names, 'HelloWorld', are only accepted if annotation processing is explicitly requested
The program running was just hello world.
Try to run your programs via command line, outside of Eclipse, just to make sure it's not an IDE configuration. If still your programs fail, try to re-install your JRE/JDK.
if still the problem occurs - provide us with the exact command line errors.

eclipse hangs when run application (application runs fine, eclipse is what hangs)

I have a single application which will cause eclipse itself to hang when run via eclipse. If I export this application as a jar and run it it works fine. But if I run (or debug) it the application will appear to start (according to ps) and run; but eclipse itself will hang, and is reported as a 'stopped' program with no CPU or memory usage. I've placed a breakpoints on the first line of this application and it doesn't even get there before eclipse ends up stopped. If I forcefully wake eclipse out of stopped state it will work; but it will also lose it's connection with the program I started. My program I want to debug will continue running but eclipse can't control or kill it after I resume the stopped eclipse.
I can run plenty of other applications without issue from eclipse. Oddly I had this issue before, then I could run my application for a day, and now I'm back to the original issue. I don't know what changed between those that would matter.
Can anyone suggest what may cause this or how to repair it?
UPDATE:
I did some more linux magic. It seems that eclipse is stopped while waiting for the command:
sh -c stty -lcanon min 1
It also seems that before that there was a sh (defunct) command which also hung without being reaped for a few minutes which I think was keeping eclipse from running properly; the sh (defunct) finally goes away if I wait long enough; but then the sh command I just linked comes up. I don't know what the original defunct SH command was; I can't do ps fast enough to catch it before it goes defunct. Both issues occur only with eclipse; as a jar file this program runs perfectly fine.
My running assumption is that eclipse isn't getting or handling the sigchild correctly? that would explain the sh (defunct) application at least. It doesn't explain the current SH command which doesn't show as defunct; despite it being something that should execute in seconds?
UPDATE 2.0:
I found this link: http://linux.about.com/od/srl_howto/a/hwtsrl13t04_3.htm basically stty is known to hang when it uses the < /dev/tty syntax; which is why the syntax is deprecated and replaced with a newer syntax. I'm pretty sure this is the problem. Sadly I have no way of figuring out what library is using the deprecated command. I think this all started with the ConsoleReader being constructed; but who knows what code actually ran the command that freezes? also, it seems if this was that broken anyone running consoleReader from eclipse on a linux environment would have the same problem; which I think is safe to assume isn't the case or it would be documented all over the net; so maybe my understanding is still off?
It is related to the configuration of the stty process that is created to attach the console and hence will occur only on UNIX like systems. Seems fixed on current 2.11 jline version.
To bypass the problem you can disable the special unix-terminal capabilities using:
-Djline.terminal=none
as VM argument on the eclipse launch configuration.
Try increasing -Xms<abc>m/-Xmx<efg>m (depending on the system memory) on eclipse.ini in the root directory of eclipse installation.
The problem was that we were using an older version of 'jline' which used deprecated functionality. The new jline jar fixed the problem, as it no longer used the deprecated stty calls. I'm not quite certain why eclipse caused this to happen every time; it seems as if it should be an intermittent error, but jline was definitely the cause.

Error when starting Datomic shell: java.lang.NoClassDefFoundError: jline/ConsoleRunner

I followed the instructions on the Datomic site: http://docs.datomic.com/getting-started.html, but I'm getting this error when trying to start up the datomic shell prompt. I'm using a windows machine. Any suggestions? I tried the same thing on my linux box and did not get this error.
Edit: moved to a different windows machine and it's working. If I have time to troubleshoot this problem and I find a solution I'll report back
I noticed that you cannot run the shell.cmd from within the bin directory, you need to call it with bin\shell.cmd from the parent directory... hope that helps.
In case you are using cygwin/bash and call bin/shell :
The java runtime on windows does not understand classpath with a ":"
but this is what you get from bin/classpath.
Either correct this or use DOS-CMD shell and call bin/shell.cmd inside.
Regards
Some tips for running datomic on Windows (7 at least):
Do not download datomic into Program Files. On startup, it creates logging directories and temp files into its own directories, so unless you run the command prompt as Administrator, you're gonna have screens full of Unable to write to file... errors.
You need to run datomic as such (assuming you extracted the download to C:)
c:\datomic-free-0.x.xxxx>bin\shell.cmd
Note the backslash. Tripped me up forever coming from *nix world.
After that, return to your regularly scheduled datomic tutorials.

Categories