BlueJ - tools.jar not found - java

I installed BlueJ today and I got the program able to load up however when I try to create/open a project the application doesn't do anything. Upon executing the command in terminal I found the error:
class Boot: tools.jar not found. Potential problem for execution. (Java home: /usr/lib/jvm/java-8-openjdk/jre)
I am not sure how to edit the Java home varaible. I have changed the /etc/environment file to contain:
JAVA_HOME="/usr/lib/jvm/java-8-jdk"
export JAVA_HOME
However that doesn't affect anything (I still get the same error message with the same path)
Manjaro 17.1.2
Linux 4.14.14-1-MANJARO
BlueJ 4.1.2-1

I had the same issue today. I run Arch Linux, which from my understanding Manjaro is pretty similar?
The problem I had was when I installed bluej I think I selected the Java 7 option when it gave me a choice between Java 7, 8, and 9.
I ran archlinux-java status to check which version I had selected on my system, and this was the result:
Available Java environments:
java-8-openjdk/jre (default)
So all I had to do was totally remove bluej (pacman -Rns bluej), and then reinstall and ensure I selected the 2) jdk8-openjdk option when given the choice. My bluej installation now creates and opens projects as expected.
Hopefully some of that information is useful, I must admit, I am pretty new to Linux, so don't really know what I am talking about. Just sharing my experience.
EDIT: I had the same problem on my other arch machine, and the issue was simply that I had the java-8-jde/jdk installed but for some reason that meant that bluej was looking in the jre for tools.jar I guess? So I installed java-8-openjdk and that solved my problem, bluej now works on this computer as well. I am yet unsure as to whether that will cause other Java issues on the system though, but I feel like it won't?

Related

Java JDK 16.0.1 installer crashing without even starting the wizard

I'm trying to install Java JDK 16.0.1. When I double-click the install file in the Downloads folder, it prompts me to allow changes, then does absolutely nothing.
I did some digging around in my %appdata% folder to look for crash reports/logs. It turns out every time I double-click the install file, it crashes with:
Exception Code: 0xC0000005
Exception Information: The thread tried to read from or write to a virtual address for which it does not have the appropriate access.
I do have Java Runtime Environment 1.8.0_291 installed, but that shouldn't prohibit the JDK installer, should it?
I also do have Java Runtime Environment 1.8.0_241 installed, and can't seem to be able to uninstall it. Could this be the problem? When trying to uninstall it, it looks for jre 1.8.0_241patch.msi, but can't find it. Regardless, this first issue shouldn't be a result of this old JRE install, correct?
I found this on the OpenJDK bug system:
https://bugs.openjdk.java.net/browse/JDK-8202316
for that user it was happening with the JDK 8 installer but the behavior sounds identical to the issue that you're having. In that post the original poster says "Problem solved. JDK 8u162 installer didn't remove all registry values of 8u152."
Now, I don't know why that's an issue; multiple JDKs should be able to peacefully coexist, but it might be worth a shot in your case before going to the length of doing a fresh reinstall of windows:
uninstall the JRE 8 version (your 1.8.0... version)
use tool or manually clean up any leftover java registry keys if necessary
reboot PC
try JDK 16 installer again
If you truly just have a JRE of version 8 and not a full-blown JDK, you could try using the java uninstall tool here:
https://www.java.com/en/download/help/uninstall_java.html
Also, I did find this old page about manually tracking down java registry entries (from 7.0 and older):
https://java.com/en/download/help/manual_regedit.html
Well, hope this helps. Be sure to let us know whether you get it solved, I'm curious to know. Thanks!

How can I run eclipse properly? [duplicate]

I have formatted my Mac due to some storage issues. Before this, I used Eclipse in a proper way. Now i have installed the JDK
Then, i have installed Java
Until now everything seems to be correct but when I open the Eclipse installer...
What can I do to fix this? I need to work with this the soon as possible.
Thanks
Eclipse on macOS will not start with Java 14 installed, this is being tracked in Eclipse bug 561273.
Installing Java 8 as well does not help. You need to remove the Java 14 install. You could use the Java 13.0.2 release instead.
Eclipse have determined that the root cause of this issue is a change in Java 14 which is described in this bug report JDK-8238225. The fix for this should be in Java 14.0.1
Update: Eclipse runs fine with Oracle Java 14.0.1 so the issue has been fixed.
I also asked this question which was closed, that's why I answer what I have found out: Eclipse will not install on Mac OS Catalina 10.15.4, saying the above error message
Failed to create the Java Virtual Machine.
Deinstalling jdk and install an older one wouldn't help on its own because Eclipse is refusing to install in the first place (as mentioned above). What I have done:
i´ve installed an JDK with boost (you can try several, mine worked with Version 13)
I edited the installer:
Download the dmg file
convert the dmg-file with "hdiutil convert /dev/disk3s1 -format UDRW -o devimage"
mount the converted dmg-file with: "hdiutil attach -owners on devimage.dmg -shadow"
Edit the /Volumes/Eclipse/Eclipse.app/Contents/Info.plist: there is a section which is commented and there you can try the jdk version. You have to give the full path to the java executable, for example:
<string>-vm</string><string>/Library/Java/JavaVirtualMachines/jdk-13.0.2.jdk/Contents/Home/bin/java</string>
Then my eclipse started from the (already) mounted Eclipse image without complaining
I had the same issue myself a while back. In your Eclipsepedia it provided an example of what the eclipse.ini file looks like when your trying to specify a JVM. So just change the eclipse.ini file and then make sure that you have all of the correct documents in that path to match the example.

Cannot install Ecplise on Mac:A Java Runtime Environment (JRE) or Java Development Kit (JDK) must be available in order to run Eclipse [duplicate]

I have formatted my Mac due to some storage issues. Before this, I used Eclipse in a proper way. Now i have installed the JDK
Then, i have installed Java
Until now everything seems to be correct but when I open the Eclipse installer...
What can I do to fix this? I need to work with this the soon as possible.
Thanks
Eclipse on macOS will not start with Java 14 installed, this is being tracked in Eclipse bug 561273.
Installing Java 8 as well does not help. You need to remove the Java 14 install. You could use the Java 13.0.2 release instead.
Eclipse have determined that the root cause of this issue is a change in Java 14 which is described in this bug report JDK-8238225. The fix for this should be in Java 14.0.1
Update: Eclipse runs fine with Oracle Java 14.0.1 so the issue has been fixed.
I also asked this question which was closed, that's why I answer what I have found out: Eclipse will not install on Mac OS Catalina 10.15.4, saying the above error message
Failed to create the Java Virtual Machine.
Deinstalling jdk and install an older one wouldn't help on its own because Eclipse is refusing to install in the first place (as mentioned above). What I have done:
i´ve installed an JDK with boost (you can try several, mine worked with Version 13)
I edited the installer:
Download the dmg file
convert the dmg-file with "hdiutil convert /dev/disk3s1 -format UDRW -o devimage"
mount the converted dmg-file with: "hdiutil attach -owners on devimage.dmg -shadow"
Edit the /Volumes/Eclipse/Eclipse.app/Contents/Info.plist: there is a section which is commented and there you can try the jdk version. You have to give the full path to the java executable, for example:
<string>-vm</string><string>/Library/Java/JavaVirtualMachines/jdk-13.0.2.jdk/Contents/Home/bin/java</string>
Then my eclipse started from the (already) mounted Eclipse image without complaining
I had the same issue myself a while back. In your Eclipsepedia it provided an example of what the eclipse.ini file looks like when your trying to specify a JVM. So just change the eclipse.ini file and then make sure that you have all of the correct documents in that path to match the example.

How to resolve "unable to find package java.lang in classpath or bootclasspath" in Dr Java?

I am new to Java. I am taking a University beginners Java course. I'm running my first hello world code and am getting an error message. I have installed the latest Dr. Java stable version and have installed Java SE 12 JDK.
I have uninstalled and reinstalled Dr. Java several times and still getting error message. I have also recompiled it to and still the error message is there.
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World");
}
}
I expected the code output to say, "Hello World" under the interactions pane but it isn't and instead there is an error message that says, "Current document is out of sync with the Interactions Pane and should be recompiled!".
Also, under the console pane I receive the following message:
Compiler is using classPath = '[C:\Users\Admin,
C:\Users\Admin\Downloads\drjava-beta-20190813-220051.jar]';
bootClassPath = 'null' Fatal Error: Unable to find package java.lang
in classpath or bootclasspath
Realizing that the OP solved his problem by version of JDK, I ran across this question after experiencing the same symptoms he describes. With that, it seems possibly appropriate to post a solution for the symptoms even though the problem ended up not being quite "identical" to the OP's situation:
I had the same problem with compilation not working. In my case, I am using a Linux system that has both OpenJDK and a manually installed Oracle JDK (extracted from a tarball obtained from java.com), along with some other JRE environments in various places. I "installed" the DrJava Version : drjava-20190813-220051 jar file and ran it from the command-line. I then clicked [ Manual Download ] when it asked about installing updates (drjava-beta-2019-220051).
DrJava reported that my compiler was JDK 8.0_222. Note, I don't know where that compiler came from. As far as I know, I didn't have that version installed. My OpenJDK was:
$ /bin/java -version
openjdk version "1.8.0_252"
OpenJDK Runtime Environment (build 1.8.0_252-b09)
OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)
I typed in a simple "Hello World" program, and every attempt to compile produced:
Compiler Output:
"Compilation completed."
This is a bug, because in fact compilation apparently did not complete.
Clicking Run produced:
Interactions
Welcome to DrJava. Working directory is /home/krb/Projects/Software/java
Current document is out of sync with the Interactions Pane and should be recompiled!
>
Restarting DrJava, saving, clicking Reset, etc., would not clear the problem.
In any event, at some point I noticed the Console tab was full of messages like:
Console
Compiler is using classPath = '[/home/krb/Projects/Software/java, /home/apps/drjava/drjava-beta-20190813-220051.jar]'; bootClassPath = 'null'
Fatal Error: Unable to find package java.lang in classpath or bootclasspath
At this point, I tried various things, but I focused on pointing DrJava to an Oracle Java JDK I had installed a few days ago. Everything I did was in Edit | Preferences ... | Resource Locations, though I beat around in there a while. All of the settings were "blank" before I started. Anyway, I eventually had some success after I'd set:
Web Browser
/usr/lib64/firefox/firefox
Web Browser Command
Tools.jar Location
/home/raid/apps/oracle/jdk-1.8.0_251/jre/lib/tools.jar
Display All Compiler Version [ ]
Extra Classpath
/home/raid/apps/oracle/jdk1.8.0_251/jre/lib
/home/raid/apps/oracle/jdk1.8.0_251/lib
NOTE: Your PATHs will NOT be the same as mine! You need to use the
actual paths on your system. In my case I searched for "rt.jar" and
"tools.jar" that were obviously in folders related to an installed
JDK.
At this point I decided to try to figure out the minimum required to get it working. After a lot of fiddling around, I found it is sufficient just to set Preferences | Resource Locations | Tools.jar Location, but with with one MAJOR caveat. You must BROWSE to the file using that dialog. YOU CANNOT JUST PASTE IN THE PATH! If you just paste in the path, it can look like it is set correctly, but the compiler will continue to not work. This was how I got the oracle jdk compiler to work.
Next, I set about to see if I could get OpenJDK to work. I searched my entire system for another tools.jar that belonged to OpenJDK, and did not find one. Then I realized I did not have the DEVEL OpenJDK package installed (on Mageia Linux 7).
java-1.8.0-openjdk-headless-1.8.0.252-1.b09.1.mga7
java-1.8.0-openjdk-1.8.0.252-1.b09.1.mga7
I installed:
java-1.8.0-openjdk-devel-1.8.0.252-1.b09.1.mga7
Now, even after resetting defaults, DrJava no longer says it is using JDK 8.0_222, but rather JDK 8.0-openjdk-1.8.0.252-1.b09.1.mga7.x86_64-OpenJDK, and everything works fine with NO customization to preferences!
I don't know where the heck JDK 8.0_222 came from. There's nothing on my system with that version. I rather suppose it is some internal thing in DrJava. I think the takeaways are:
If DrJava says its using JDK 8.0_222, it probably is not going to work!
Make sure you actually have a tools.jar installed if your system might split up the OpenJDK installation.
Point Tools.jar Location to an existing tools.jar file where the JDK you are using is installed, and making sure to browse to it (not just paste in a path).
I know what I saw was with Linux and a .jar install of DrJava, and this might not be what you have, but perhaps the information will be helpful in offering you things to look at and try.
As the answers above state, DrJava is not compatible with newer versions of Java than Java 8. Most of the DrJava codebase was written long before the open source version of Java was viable. The Sun Microsystems and Oracle javac compilers are proprietary and cannot be distributed with open source apps like DrJava. So DrJava searches for tools.jar (the library file containing the compiler in Java JDK distributions prior to Java 9) in common locations on Windows, Mac OS X, and Linux to find a compiler (more accurately, what were common locations in 2007). If you are running DrJava from a Java 8 JDK, it almost always finds it (although it appears to be failing for some installations Amazon Corretto 8). The most recent available build (March 3, 2020) of DrJava at www.cs.rice.edu/~javaplt/drjavarice may do a better job. I know it includes a later version the open source Java 8 compiler (JDK 8.0_242) and that it also finds the compiler (JDK 8.0_265) in the Corretto 8 distribution that I am using on Windows 10. The mysterious version of the open source JDK compiler reported above is being retrieved from the drjava.jar file itself. Now that the open source JDK includes a reliable compiler (which I suspect is nearly identical to the Oracle Java 8 SE compiler), the drjava.jar file includes a recent build of the open source Java 8 compiler.
Your solution helped me troubleshoot a problem with DrJava not recognizing the Amazon Carretta JDK on a Mac.
The fix is to open DrJava and go to Edit -> Preferences -> Resource Locations. From the Tools.jar Location box you must use the three dots at the end of that box to navigate to the tools.jar file on your Mac, which is probably in /Library/Java/JavaVirtualMachines/amazon-corretto-8.jdk/Contents/Home/lib/tools.jar.

Run eclipse on windows 7 64 bit

I'm trying to run eclipse for java in Windows 7 64bit edition, and when I run the eclipse.exe file, absolutely nothing happens. A ephimeral javaw.exe process is created in the task manager, but as I said, it's just there for a split second, and it disappears, after that NOTHING. I tried compiling a small program with the javac.exe file, and that works all right, but for some reason I cannot run Eclipse.
Any suggestions on what I could be doing wrong. I'm a complete Java noob, it's the first time I try to do this.
These are the files I have, and I downloaded the Windows 64bit version of eclipse.
Thanks!
EDIT
OK, solved. The book I'm using is misleading... it said I should use the javaw.exe file from jdk1.6.0_21, and doing that didn't work. Now I tried with one in jre6, and it ran.
Thanks everyone and sorry for the hassle!
First, check you eclipse.ini (even a space at the end of a line can prevent eclipse from starting)
Second I am surprised to see java* file in your Eclipse distribution.
You shouldn't' have those, and instead refer to the right java (64 bits) in your eclipse.ini.
In both case, see this eclipse.ini as a good example.
Check also the <workspace>/.metadata/.log (error log file).
I just added it there because it was asking for it, supposedly the best way it to put it in the PATH.
If eclipse is "asking for it", that means your current java installation is not part of the PATH. It need to be reference from the eclipse.ini file.
See also FAQ How do I run Eclipse?
In any event, don't copy any java files around.
Used in your eclipse.ini a path like:
-vm
C:/Prog/Java/jdk1.6.0_21/jre/bin/server/jvm.dll
Do you have the 64-bit version of Java? http://www.java.com/en/download/faq/java_win64bit.xml
I experienced relatively little trouble moving to 64-bit java:
Download Eclipse Helios 64-bit version
Download Java 6 SDK 64-bit version
Install both
Run
The issues may arise if you have both 32-bit and 64-bit JDKs in the same machine. If you want to explicitly run Eclipse with one JVM, then you need to specify its full path in eclipse.ini.
e.g.
-vm
C:/Program Files/Java/jdk1.6.0_20/bin/javaw.exe
Where the path points to the 64-bit version.
The other issue I encountered after moving is that the Subclipse plugin by default uses a 32-bit DLL backend and therefore doesn't work. However Subclipse also works with a pure-Java back-end for Eclipse called JavaHL which solved that issue.
I faced similar problem and did not know how to proceed.
I did following things to resolve it.
In eclipse.ini enter the vm argument to which jre you want to use
-vm
C:\Java\jdk1.7\jre\bin\javaw.exe
If you have -Dosgi.requiredJavaVersion=1.7 line in your eclipse
make sure that version is matching the one that is mentione in step 1.
( in my case it was 1.6 and I had to change this value to 1.7)
Launch eclipse.exe from the command line

Categories