Different Eclipse configurations both with issues all of a sudden?

Custom indicators, trading strategies, data export and recording and more...
dmavro
Posts: 50
Joined: Thu Sep 24, 2020 9:20 pm
Been thanked: 1 time

Different Eclipse configurations both with issues all of a sudden?

Post by dmavro » Thu May 05, 2022 8:03 pm

Hey guys,

I went to do some work in eclipse after not using it for a few months and had my desktop and laptop both giving me errors for all my projects in each of my workspaces. My laptop wouldnt even let me do gradle builds in powershell anymore with existing projects that i knew worked. I did let Java updater do its thing on both machines recently. Can that screw things up at times? This issue has happened on laptop once before though and it took me forever to get things working again. I eventually ended up following the instructions here on the forum and reinstalled Java, Gradle, Git and Eclipse again like i was setting up everything for the 1st time.

This time however i was able to get laptop working again but not 100% sure how. I had an issue with my JRE_LIB in classpath variables in eclipse settings and updated that but it didnt fix all the projects. Eventually after playing around with individual project settings for the rest of them i was able to get everything working. 

Im now in process of getting the configuration on my desktop in working order (been changing the Build path for individual projects) but i just noticed that each computer Eclipse configuration is different.

I also see quite a few things listed as deprecated in my Eclipse classpaths variables, some projects have JRE System Library listed under Modulepath and others have it under Classpath and there are a few other things ive noticed.

Im trying to figure out which way is correct so I can avoid having issues again in the future. Right now  my environment seems fine on my laptop(no project errors in Eclipse and I can build all projects in PowerEditor.)  I’m also not having issues with any of the projects that ive changed settings for on my desktop.

Just wondering though…Could having different settings for Eclipse on each machine be the reason things keep breaking?
If anyone could assist then that would be great. Basically trying to figure out which of my setups is the one i should be following if either. If not then what is correct config. Took some screenshot of the different settings if it will help.

FYI- Im using Eclipse Version: 2021-09 (4.21.0) on both machines.
 
Thanks in advance,
Dean
 

AndreyR
Posts: 458
Joined: Mon Jul 09, 2018 11:18 am
Has thanked: 18 times
Been thanked: 71 times

Re: Different Eclipse configurations both with issues all of a sudden?

Post by AndreyR » Fri May 06, 2022 8:03 am

Hi. Yes screenshots will be hepful. Make sure the Problem view is enabled in your Eclipse so errors are visible in the screenshot (see the example attached).
Attachments
Clipboard01prbl.jpg
Clipboard01prbl.jpg (179.31 KiB) Viewed 394 times

dmavro
Posts: 50
Joined: Thu Sep 24, 2020 9:20 pm
Been thanked: 1 time

Re: Different Eclipse configurations both with issues all of a sudden?

Post by dmavro » Fri May 06, 2022 6:12 pm

Andrey,

Thanks for taking the time. The picture below shows the error im seeing in eclipse on desktop currently. 

Rebuild_errors.png
Rebuild_errors.png (331.56 KiB) Viewed 385 times

My laptop classpath variables look like this...
lap_classpath.png
lap_classpath.png (599.76 KiB) Viewed 385 times
and my desktops look like this...
pc_classpath.png
pc_classpath.png (183.76 KiB) Viewed 385 times

I noticed that most are deprecated and that some on each system are empty. I also saw that on desktop Eclipse is giving a JRE_LIB warning at bottom and laptops Eclipse is giving a JRE_SRCROOT warning. Plus laptops JRE_LIB looks like its version11 and desktops is 17.

These are the JRE's i have for each system...
Laptop-
lap_InstalledJRE.png
lap_InstalledJRE.png (293.84 KiB) Viewed 385 times
Desktop-
pc_InstalledJRE.png
pc_InstalledJRE.png (49.74 KiB) Viewed 385 times

When i looked at my projects i saw something i dont understand. Under Java Build Path Source and under Order and Export i had different structures....
Laptop-
lap_Source.png
lap_Source.png (372.82 KiB) Viewed 385 times
lap_OE.png
lap_OE.png (378.59 KiB) Viewed 385 times

Desktop-
pc_Source.png
pc_Source.png (130.04 KiB) Viewed 385 times
pc_OE.png
pc_OE.png (82.4 KiB) Viewed 385 times

Did my using a different version of Eclipse or java at one point on each machine cause them to not match anymore? Assumed they should match since they are same project just on different computers. When i started using my laptop also with Eclipse i would move my projects from computer to computer via OneDrive when i was done. Then i would delete version from other computer and import the one i had been working on.    

Thanks again for taking time to help me resolve this.

Dean
 

dmavro
Posts: 50
Joined: Thu Sep 24, 2020 9:20 pm
Been thanked: 1 time

Re: Different Eclipse configurations both with issues all of a sudden?

Post by dmavro » Tue May 10, 2022 8:18 pm

I researched my issue during weekend and think i am starting to understand a bit more about the process of setting up the Java environment on my computer and my Eclipse configuration. After looking at a ton of information i have a few questions.

1. When i checked my Environment variables in windows i noticed that i have C:\Program Files (x86)\Common Files\Oracle\Java\javapath(1st in list) and C:\Program Files\Java\jdk1.8.0_311\bin both in my Path system variable. However, when i was looking at posts pertaining to the default JRE Eclipse uses i saw a lot of posts discussing  a separate JAVA_HOME environment variable. Is it better practice to utilize JAVA_HOME variable or is my setup fine? 
 
2. I remember trying a newer version of Eclipse a while back and believe i used one of the installer downloads. Could that be a possible culprit or is it more likely that i screwed something up doing an import and export between my pc's? 

3. During the process of getting things to work again should i also be making sure my desktops Java environment matches my laptops environment? Or do you usually rely on JDK Compliance setting under Java Compiler for individual Eclipse projects to take care of that? 

4. I have the following Java installations on my desktop...
pc_installed.png
pc_installed.png (61.22 KiB) Viewed 360 times
and my installed JRE's look like this...
installed_jre.png
installed_jre.png (31.35 KiB) Viewed 360 times
Anything need to be done with either of those?

5. Ive gotten everything to a point where Eclipse now shows no errors in Problem pane for any projects that i had working in the past.  However, i do see some warnings in Error Log pane that im not sure about...    
pc_errorlog.png
pc_errorlog.png (71.55 KiB) Viewed 360 times
Should i be concerned about any of them?

6. When i try to do a gradle build via powershell i get this error still... "Could not find tools.jar. Please check that C:\Program Files\Java\jre1.8.0_331 contains a valid JDK installation." I have Java 8 update 331 installed (see prior pic) already. How do i rectify that? 
  
Sorry for all the questions. Im just trying to get a better understanding of everything so i can avoid having this happen again in future and if it does at least then ill be able to recover from it on my own. 

Any help would be greatly appreciated,
Dean

AndreyR
Posts: 458
Joined: Mon Jul 09, 2018 11:18 am
Has thanked: 18 times
Been thanked: 71 times

Re: Different Eclipse configurations both with issues all of a sudden?

Post by AndreyR » Mon May 16, 2022 2:59 pm

Hi Dean. Can you please run these commands in powershell and tell me the output for each (each line is a separate command).
where java
java -version
gradle -version

dmavro
Posts: 50
Joined: Thu Sep 24, 2020 9:20 pm
Been thanked: 1 time

Re: Different Eclipse configurations both with issues all of a sudden?

Post by dmavro » Wed May 18, 2022 1:25 pm

AndreyR wrote:
Mon May 16, 2022 2:59 pm
Hi Dean. Can you please run these commands in powershell and tell me the output for each (each line is a separate command).
where java
java -version
gradle -version

Hey Andrey,
Thanks for responding. I was actually able to get my desktop to build projects again without giving me any errors a few days ago. DIdnt get a chance to give an update here because ive just been super busy this week. I do however still see something odd taking place whenever I check my java build paths for my individual projects. What happens is when i first check the Library tab the module path looks like this....
buildPATH.png
buildPATH.png (132.9 KiB) Viewed 309 times
If i click on any other tabs i get this message.....
buildpathMES.png
buildpathMES.png (34.91 KiB) Viewed 309 times
Then if i go back to the Library tab i see this now...
buildpathCHG.png
buildpathCHG.png (43.5 KiB) Viewed 309 times
If i hit apply and then go back and check again it still show the path as the first pick. The changes its trying to make on its own dont get applied. Cant figure out why its doing that.

Any ideas?

Here are the results i get from running your requests in powershell...

PS C:\Users\deanm\Documents> where java
PS C:\Users\deanm\Documents> java -version
java version "1.8.0_331"
Java(TM) SE Runtime Environment (build 1.8.0_331-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.331-b09, mixed mode)
PS C:\Users\deanm\Documents> gradle -v

------------------------------------------------------------
Gradle 6.8.3
------------------------------------------------------------

Build time:   2021-02-22 16:13:28 UTC
Revision:     9e26b4a9ebb910eaa1b8da8ff8575e514bc61c78

Kotlin:       1.4.20
Groovy:       2.5.12
Ant:          Apache Ant(TM) version 1.10.9 compiled on September 27 2020
JVM:          1.8.0_331 (Oracle Corporation 25.331-b09)
OS:           Windows 11 10.0 amd64

Also, still have everything deprecated in Classpath variables for Eclipse....
classP.png
classP.png (93.7 KiB) Viewed 309 times


Thanks again,
Dean

AndreyR
Posts: 458
Joined: Mon Jul 09, 2018 11:18 am
Has thanked: 18 times
Been thanked: 71 times

Re: Different Eclipse configurations both with issues all of a sudden?

Post by AndreyR » Mon May 23, 2022 3:05 pm

Hi Dean,
different Eclipse versions may look different. I have no idea why your changes do not get applied. On the other hand, there may be some deprecated classpath variables that should not affect your projects.
Regarding this one
When i try to do a gradle build via powershell i get this error still... "Could not find tools.jar.
Have you added the JAVA_HOME system variable?

dmavro
Posts: 50
Joined: Thu Sep 24, 2020 9:20 pm
Been thanked: 1 time

Re: Different Eclipse configurations both with issues all of a sudden?

Post by dmavro » Thu Jun 02, 2022 4:21 pm

AndreyR wrote:
Mon May 23, 2022 3:05 pm
Hi Dean,
different Eclipse versions may look different. I have no idea why your changes do not get applied. On the other hand, there may be some deprecated classpath variables that should not affect your projects.
Regarding this one
When i try to do a gradle build via powershell i get this error still... "Could not find tools.jar.
Have you added the JAVA_HOME system variable?

I never added JAVA_HOME in system variables but I am able to build projects again as mentioned in my post from May 18th. My Java variables are located in the Path variable like this....
PathPic.png
PathPic.png (78.79 KiB) Viewed 199 times

Is using JAVA_HOME variable the recommended approach or does it not make a difference? 
 

AndreyR
Posts: 458
Joined: Mon Jul 09, 2018 11:18 am
Has thanked: 18 times
Been thanked: 71 times

Re: Different Eclipse configurations both with issues all of a sudden?

Post by AndreyR » Wed Jun 08, 2022 1:56 pm

Although using JAVA_HOME variable is the recommended approach, everything should work just fine without setting it in 99 cases out of 100.

Post Reply