Eclipse error 'g++/gcc' not found in path - java

I have installed Eclipse 4.3 Juno. My environment is split into two separate workspaces. One is for Java and one for c/c++.
When I run the eclipse for C I can work with it and compile my projects.
eclipse -data d:\src\c -vmargs -Xmx512M
Now when I run the environment for Java development I suddenly get this error:
error 'g++/gcc' not found in path
The two workspaces are completely separated with their own .metadata directories.
I tried various hints that I found here and via google, like resetting the preferences, but nothing helped. Since I can work with my C environment it should be proof enough that the compiler exists. :) It is also in the PATH variable, so when I use g++/gcc on the windows commandproampt I get access denied (because it's cygwin).
So How can I get rid of this annoying error when I run my eclipse only for Java. I don't even need CDT there, but the plugins are probably installed in eclipse and not in the workspace. So this has to be some path setting or so, which I changed for the C but not for the Java environment.

So finally I found a solution. I got the hint from here Configure Eclipse CDT to use g++
The important bit was the comment that g++ is a symbolic link. Everything was set up ok, but when I executed g++ or gcc from the windows command prompt, I got the error "Access denied" while it worked from within cygwin.
After reading the bit about it being a symbolic link, it was clear what the problam was, because Windows can not cope with it. So what I did now, I reversed the symbolic links such that gcc and g++ is the real exe and the links of g++-3 and so on are pointing now to the exe, instead of the other way around.
I had to restart eclipse using the -clean option, then restarted it normaly and the error is history. :D

You should install the build-essential
sudo apt-get install build-essential
after installing this, open a terminal, and type g++ (hit enter) if it says there is no input, then you got your g++
I mean, eclipse is good but problems like this are persistent I find.
Try giving NetBeans a look in.

Related

Could not find or load main class com.nabinbhandari.lam.Main

I've read a lot of troubleshooting for similar occurrences of this error, but what is causing it for this particular .jar?
https://download.cnet.com/android/nabin-bhandari/3260-20_4-10982661-1.html
It works on Windows, but when attempting to run the file on a raspbian (linux) system running java version 1.8.0_65 with the command java -jar Local\ Area\ Messenger\ Desktop.jar it throws the error about not being able to find or load the main class.
The MANIFEST.MF defines Main-Class: com.nabinbhandari.lam.Main and there doesn't appear to be any issues with case sensitivity.
What am I missing? Do I need to install something more than Java Runtime Environment?
Edit: In case it is not clear, I am not the developer of this file. I am simply a user trying to run the file. This question has nothing to do with Eclipse and I don't understand why people are linking to that other question. I am not running Eclipse. Please stop linking to that. Please examination the .jar file I have provided.
Edit 2: I have followed the instructions and in this answer:
https://stackoverflow.com/a/1238173/2407742
It gives the error no main manifest attribute, in test.jar
Is there something missing from my java runtime environment? It seems like nothing works.
The Local Area Network Messenger application was developed using JavaFX, which is not included in the Oracle Java build for Rasperry Pi. I had to reinstall Java and then openjfx by doing the following:
sudo apt-get purge openjdk-8-jre-headless
sudo apt-get install openjdk-8-jre-headless
sudo apt-get install openjdk-8-jre
sudo apt-get install openjfx
It runs fine now.
The solution to this was the following:
Close Eclipse/STS
Use a file explorer on your operating system to navigate to your workspace (In my case, I'm on Windows so I used Windows Explorer)
Delete the .metadata directory (or to be safe, copy the directory somewhere else to be safe, then delete it)
Restart Eclipse/STS
Is there a more improved answer than this? I don't want to look like I'm trying to boost my own reputation points, so if someone can provide a better answer then please do so.

java how to check version being used by 'jar launcher.app' on Mac OS

I have several .jar files that run successfully when opened with Mac's built in 'Jar Launcher' (Version 15.0.1) but when ran from terminal they error out.
Looking online the error messages might be down to the incorrect version of Java being linked to the terminal version, so I'd like to check if the options set for 'Jar Launcher' and the Java used within terminal are the same.
Does there exist any way to do this?
This question is two years old, but as there is no answer to it, I thought I'd put my two cents here since I've had issues myself, and have made some observations.
It seems that the Jar Launcher doesn't necessarily use the same JVM version as the one shown by the command /usr/libexec/java_home: If there is a JRE /Library/Internet Plug-Ins/JavaAppletPlugin.plugin, then the Jar Launcher will use it and ignore anything in /Library/Java/JavaVirtualMachines.
I've solve my problem of version mismatch between the Jar Launcher and the terminal by removing the JRE:
Go to /Library/Internet Plug-Ins.
Remove the JavaAppletPlugin.plugin directory by executing the rm command as a root user or by using the sudo tool.
Go to /Library/PreferencePanes.
Remove JavaControlPanel.prefpane by executing the rm command as a root user or by using the sudo tool.
Source: https://docs.oracle.com/javase/9/install/installation-jdk-and-jre-macos.htm

re install Jdk1.6 in windows 7?

I have installed jdk1.6 in E: drive of windows 7.I developed a simple .java file and try to run it through the command prompt using "javac" but it says javac is not recognized as internal or external command.So i checked just by running java it runs fine .so I thought that i should uninstall that jdk and reinstallit but i am getting windows 1723 error
opened a control panel and tried to remove jdk from there but got this "Error 1723.There is problem with this Windows Installer package.A DLL required for this install to complete could not be run.Contact your support personnel or package vendor"
to be able to run javac from the command line, you need to add the path to javac to the PATH environment variable.
It looks like the 1723 error describes a problem with the installer itself. I would follow the advice from Microsoft Answers and Oracle to fix the installation. A correct install of Java should add the necessary entry on the Windows PATH. Make sure you open a new DOS (or Command) window after installation otherwise the amended PATH might not be picked up.
Probably,you are facing the below issue: https://forums.oracle.com/forums/thread.jspa?threadID=2213081. You can use ccleaner to uninstall all the instance of jdk/jre.The issue is happening due to interrupting in installing/uninstalling.If ccleaer is not solving your problem registry cleaning is the only option as shown on the above link.
You probably have java.exe on your \windows\system32 folder... And since this folder is on the path env var it got confused. Try to delete this/these java*.exe files from \windows\system32 folder.
If you encountered a problem with Java error 1723 when you try to reinstall Java.
It may occur when you delete the Java directory by error
_ Go to your Microsoft Event Viewer you'll see one error line like this
Event viewer
_ Then copy an Java bin directory from an other server to have back the lost dlls in the directory mentioned in the events viewer
_ finally reinstall Java
Hope it helps
I have used Microsoft utility(fix-problems-that-block-programs-from-being-installed-or-removed) to resolve this error it saved me doing manual work and it is safe also :
https://support.microsoft.com/en-us/help/17588/fix-problems-that-block-programs-from-being-installed-or-removed

Java is not working in my PC

I had installed Java in my PC and it was working perfectly. Suddenly something went wrong and now I m not able to open swing applications and its showing the error 'Java not found'. But I can run the Eclipse IDE which also needed Java to run. So I decide to reinstall the Java, but when I tried to uninstall the Java it shows the Error 1723 - There is a problem with this Windows Installer Package. So I have installed a new JDK in another location and set the PATH. Still I am not able to run the Swing application.
Can anybody help me on this?
How are you running your swing application?
If it's from the command line like java mySwingApp and you're getting java not found then your PATH isn't set properly. Make sure that the java/bin directory is on your PATH not just the top level directory. You can test your PATH by just typing java in a console window - it should print the java help page.
If you're not running from a terminal like above, then you may need to set a JAVA_HOME environment variable which points to your java installation folder. Here's a tutorial on setting JAVA_HOME
Setting JAVA_HOME
Hope this helps,
Will
This is close to jakob's answer, about trying to get your Java install setup correctly again, just with a little more detail.
I had a similar problem on my Windows 7 box where I was trying to uninstall Java and do a clean install of a newer version. Something got messed up and I would get the 1723 error message during the uninstall and attempted reinstall. Here's information about how I was able to fix the problem, and maybe this will help you:
Look at the log files for the uninstall/reinstall. On Windows 7 they can be found at c:\users\username\AppData\Local\Temp\
The java_install.logdidn't show any extra information, but I had several MSI##### log files that contained error messages about the failed uninstall. The message was: Error 1723.There is a problem with this Windows Installer package. A DLL required for this install to complete could not be run. Contact your support personnel or package vendor. Action UninstallJRE, entry: MSIUninstallJRE, library: C:\Program Files\Java\jre6\bin\regutils.dll
There was indeed no regutils.dll file, and not even the bindirectory was there. So I copied over a regutils.dll file from another computer, ran the uninstaller, and it worked. Then the new clean install of Java also worked.
So take a look at your logfiles and hopefully that will give you more detailed information about the 1723 error.
This usally happens when you delete Java files manually.
If you try to uninstall Java and it fails, it generates a log file.
Should be in C:\Users[Username]\AppData\Local\Temp
Almost at the end the missing file(s) can be found.
Try to copy that file(s) from a working installation to your computer.
Then you should be able to uninstall your Java and install a new version.

Getting error "bash: appletviewer: command not found".

I'm trying to learn Java and I'm having problems with the appletviewer command. I am using openSUSE 11 and am able to compile and run normal java programs but when I issue the appletviewer command I'm getting the following error "bash: appletviewer: command not found".
I have set the PATH variable in the .bashrc file. so the problem is not that of the path. This can also be verified from the fact that javac and java commands are working normally. I have googled and tried many said resolution but none is working. I have even tried moving the files to the bin folder and running the command from there.
So what may the cause of this? Isn't appletviewer designed to work in linux? And FYI I have replaced the OpenSDK and IcedTea versions with the jdk1.6.0_14 version from the sun site. Please help.
Thanks
Chris
As a test, do the following:
$which java
$which appletviewer
Check to see if the paths are different. If the second command gives no output, appletviewer may not even be installed (or can't be located by your system).
You need to install java-1_6_0-sun-devel-1.6.0.u14-0.2.1
$ sudo zypper install java-1_6_0-sun-devel
You will find it in the openSUSE-11.1-Non-Oss repository.

Categories

Resources