I've been working on my desktop computer which has openjdk 7.
When I copy a Grails project onto my laptop, which has Oracle's JDK v7, I'm having a problem with the classpath.
I've checked the classpath and everything seems fine.
Here's the text that GGTS shows:
The archive: /usr/lib/jvm/java-7-openjdk-amd64/lib/tools.jar which is
referenced by the classpath, does not exist
I set the JAVA_HOME inside /etc/profile.
I installed gvm in order to make easier Groovy and Grails setup.
I hope you could help me
:)
I then went to the RUN menu option at the top and selected run configuration
It was on : Grails \ {Myproject} (run-app)
On the right for this run-app there is JRE options
under JRE ensure you have the same JRE defined as project in this case 1.6
I'm guessing that your JRE reference in your project is bad. Is your desktop windows and your laptop a mac or linux (or vice versa)?
Try these things:
Does the /usr/lib/jvm/java-7-openjdk-amd64/lib/tools.jar path exist on the broken system?
Can you create other kinds of projects on the broken system?
Can you create a new Grails project from scratch inside of the broken GGTS?
What happens if you run Grails -> Refresh dependencies on the project?
Related
We want to use both SWT and JavaFX in an Eclipse plugin within our RCP application. Unfortunately, we're experiencing problems integrating SWT with JavaFX under Java 11. The build environment uses e(fx)clipse 3.5. We're developing against the Community edition of Azul Systems' "Zulu" JDK 11, bundled with Azul's version of OpenJFX.
Formerly, we developed under Java 8. At that point, our build used a compile-time class path referring to jfxswt.jar, which lived in the jre/lib directory of the JDK. We didn't use any special class path settings at run-time.
We are now trying to move to Java 11. There, this JAR has become javafx-swt.jar and lives in the lib directory of the JDK. It no longer seems to be enough to set the class path to refer to this JAR at compile time: it seems to be necessary to do so at run time too. If we don't do this, we get an error (java.lang.NoClassDefFoundError: javafx/embed/swt/FXCanvas).
As a test, we experimentally embedded javafx-swt.jar within the JAR implementing our Eclipse plugin. We then referred to it in that plugin's .classpath file, and the code worked as expected. Unfortunately, we can't embed the JAR this way for legal and other reasons.
A note on Java modules: javafx.swt does not show up in the output when we issue the --list-module command. We tried running the application using parameters -p /path/to/JDK/lib/javafx-swt.jar --add-modules javafx.swt, but this doesn't seem to solve the problem.
My question: Is there a way to set up the class or module path to allow our Eclipse plugin to find this library in the JRE? Any solution would have to work with whatever JRE the code happens to be run against (I think it is all right to assume lib/javafx-swt.jar will live in that JRE).
Would it help to use a separately-downloaded version of OpenJFX rather than the copy of OpenJFX in our JDK?
Very many thanks ☺
Disclaimer: I am new to Java, new to Linux, and new to Netbeans - apologies for any over/under explanation - please ask and I will add/remove info.
I have a model written in Java in Netbeans 8.2 that has been successfully running in NetBeans 8.2 on Mac OS. This version of NetBeans was downloaded with JDK8u171 (JDK/Java package).
All components of the model have successfully transferred through FTP (filezilla) to a remote Linux machine.
The Linux machine has a copy of Netbeans 8.2 and has java/1.8.0-oracle (and 1.6.0 and 1.7.0), and has java/1.8.0-openjdk (similarly, 1.6.0 and 1.7.0 also).
I am assuming that 1.8.0-oracle is the equivalent of JDK8u171 but I may well be wrong.
When I load netbeans using
module load java/1.8.0-oracle
module load netbeans
netbeans
The program opens (via remote desktop - x2goclient), and I can search for the project and open it.
Once open, I see:
'myprojectitle (broken)' in the project window on the left of the NetBeans GUI
right click -> resolve problems
...opens a screen saying
'The JDK is missing and is required to run some NetBeans modules Please use the --jdkhome command line option to specify a JDK installation or see http://wiki.netbeans.org/FaqRunningOnJre for more information.'
Does this mean I am using the wrong jdk/java package?
Or is the jdk package configured incorrectly in Netbeans, if so how can I reconfigure?
Any help would be greatly appreciated.
The solution to this was found at
The JDK is missing and is required to run some NetBeans modules
Whereby, java/1.8.0_171 needed to be installed and then netbeans needed to be opened as follows:
netbeans --jdkhome /path/java/1.8.0_171
Apologies for a repeat, but hopefully this answer can either redirect or offer a solution
I'm doing a Java project which involves JavaFX. I'm using Eclipse Oxygen with Java 8 (java-8-openjdk-amd64) and I installed the Eclipse plugin e(fx)clipse.
I don't understand why this project has two errors:
The project was not built since its build path is incomplete. Cannot find the class file for javafx.geometry.Point2D. Fix the build path then try building this project
and
The type javafx.geometry.Point2D cannot be resolved. It is indirectly referenced from required .class files
I searched on StackOverflow for similar problems, and tried some settings changes but nothing solved my problem.
I tried to change the access rules in the Build Path of my project: Build Path > Configure Build Path > Libraries > JRE System Library > Add a new rule
I added different rules: javafx/**, changed it to **/javafx/** but nothing changed.
This project works well in Windows, I opened it with Eclipse on Windows and everything works fine.
Do you have an idea on how to solve this problem?
EDIT: Accepted answer: $ sudo apt install openjfx
It looks like you haven't installed JavaFX. Because some parts of JavaFX are not compatible with the distributions open source licenses, it often is not part of the packages shipped by default.
If you're using Ubuntu, you can install it using sudo apt install openjfx.
For further reading have a look at JavaFX and OpenJDK.
I'm trying to setup a fresh installation of Eclipse Oxygen at work, and I'm running into this issue when trying to checkout any project.
Import -> Checkout Projects From SVN ->
I'm trying to migrate from an old Mars installation with the same plugins, so maybe it has something to do with two installations trying to share the same path (Or trying to search on their own path the configuration files). I was given the original installation "as is", so I don't really know how the configuration process went (And yeah, it works just fine).
Any idea?
Your problem is that when the native Subversion JavaHL DLL's are being loaded, they try to load all of their dependencies. This includes the OpenSSL DLL's (libeay32.dll and ssleay32.dll). These DLL's are included with JavaHL but it looks like you have some other version higher in the PATH. More importantly these are 32-bit DLL's and you are running in a 64-bit JVM and loading 64-bit JavaHL. So it cannot use them.
Maybe you can fix your PATH to get rid of these? If not, you probably have to run 32-bit Eclipse using a 32-bit JVM.
You can also ignore the error and install the SVNKit adapter and choose to use that in your preferences under Team > SVN.
Take a closer look at the errors on the screenshot. It seems that there is a problem with java.library.path or %PATH% environment variable.
I have a Java Application on Eclipse using jdk1.7.0_72
I am having an issues when running a project from a runnable jar, the application works perfectly when ran from Eclipse. The application uses a cacert which for some reason fails when I use the runnable jar. What I have noticed is that the java version of the runnable jar is different when I run it from Eclipse. This is causing issues.
Here is a snippet of the system properties when I run from Eclipse:
**sun.boot.library.path=C:\Program Files\Java\jdk1.7.0_72\jre...
java.vm.version=24.72-b04
java.runtime.version=1.7.0_72-b14
java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment
java.endorsed.dirs=C:\Program Files\Java\jdk1.7.0_72\jre…
java.library.path=C:\Program Files\Java\jdk1.7.0_72\bin…**
Here is a snippet of the system properties when I run from JAR:
**sun.boot.library.path=C:\Program Files\Java\jre7\bin
java.vm.version=24.75-b04
java.runtime.version=1.7.0_75-b13
java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment
java.endorsed.dirs=C:\Program Files\Java\jre7\lib\endorsed
java.library.path=C:\Program Files\Java\jre7\bin;C:\Win…**
How can I make the JAR use the same version that Eclipse uses?
Also when I run java -version I get this:
"1.7.0_72"
When I click on About Java, I get this:
"1.7.0_75-b13"
If you run a JAR it'll use the Java version you set up on the PATH variable. If you run it from Eclipse you can tell Eclipse which version to use. As you can see the library.path variable is different, so you're loading a different Java in each case.
You can either set the proper Java version in the PATH variable or set it in Eclipse in the Preferences - Java - Installed JRE's menu.
It looks like you have at least two Java version installed on your machine.
Java 1.7.0_72-b14 is configured in your Eclipse
Java 1.7.0_75-b13 is configured in your PATH
You can change the java in your environment system variables according to this guide:
https://docs.oracle.com/javase/tutorial/essential/environment/paths.html
You are most definitely using different JRE's.
You have both the JDK and the JRE installed. It just so happens that the JDK has an internal JRE which you can see in the first line:
**sun.boot.library.path=C:\Program Files\Java\jdk1.7.0_72\jre...
The JRE is installed here
C:\Program Files\Java\jre7\bin
Your best option is to point Eclipse to execute your JAR using the installed JRE since the other option is to require the JAR to use the Eclipse JDK/JRE which would be problematic if you wanted to distribute the JAR to machines that didn't have Eclipse installed.
In Eclipse you can designate multiple JRE's and name them, create a new one and give it this path, then you can go to your project's run options and tell it to use this library when running your JAR.
"The java version of the runnable jar" cannot be different because of different execution environments: it's the JVM version.
The issue is that the jar is compiled with an higher version than the execution environment.
In the Eclipse IDE:
in Window/Preferences go to Java/Installed JREs
add your 1.7.0_72-b14 JRE
check the newly added JRE as the default for the workspace
Clean/recompile the project an re-export the jar file with File/Export/jar file