liferay / liferay-intellij-plugin

Other
24 stars 30 forks source link

System environment variables are not set #257

Closed Elinvention closed 1 year ago

Elinvention commented 1 year ago

If I run Liferay with this plugin, System.getenv() returns a HashMap with a single variable: SystemRoot -> C:\WINDOWS. All system variables disappear, but I need the Path variable to be present. I don't know if it's just a configuration issue on my side or if this is intentional.

simonjhy commented 1 year ago

@Elinvention which version you found this issue? Can you help to give some reproduce steps? I think this will be more helpful.

Elinvention commented 1 year ago

File->Help->About

IntelliJ IDEA 2023.1 (Ultimate Edition)
Build #IU-231.8109.175, built on March 28, 2023
Licensed to Elia Argentieri
Subscription is active until September 11, 2023.
For educational use only.
Runtime version: 17.0.6+10-b829.5 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 2036M
Cores: 4
Registry:
    editor.focus.mode.color.light=474747
    ide.editor.tab.selection.animation=true
    debugger.new.tool.window.layout=true
    ide.new.editor.tabs.vertical.borders=true
    ide.experimental.ui=true
    ide.balloon.shadow.size=0
    editor.focus.mode.color.dark=474747

Non-Bundled Plugins:
    lermitage.intellij.extratci (1.24.0)
    com.nasller.CodeGlancePro (1.6.1)
    com.wafer (1.8)
    marcglasberg.HibernateInspectionsPlugin (1.6)
    J2EECfgFile (1.0)
    Builder Generator (1.3.0)
    com.liferay.ide.intellij.plugin (2.0.4)
    net.seesharpsoft.intellij.plugins.csv (3.1.0-231)
    com.haulmont.jpab (2023.1.4-231)
    com.chrisrm.idea.MaterialThemeUI (8.6.3)
    com.mallowigi (90.0.0)

Kotlin: 231-1.8.20-IJ8109.175

I tried to reproduce this issue by creating a new Liferay project, copying over the bundles folder, add Liferay server configuration, run in debug and I have the issue. Maybe something is odd in my bundles. I'll look into that.

Elinvention commented 1 year ago

I have this issue even with a fresh bundles folder.

simonjhy commented 1 year ago

I tried to create a new workspace project and copied the bundles from a old bundles folder, then manually add server configuration. I felt confused that I am not sure where to verify the System.getenv() just return SystemRoot? or we need to add codes in some places?

Elinvention commented 1 year ago

You could make a Portlet that logs System.getenv() or more conveniently you could launch Liferay with the debugger, make it stop on exceptions, then evaluate System.getenv() with the debugger. Either way I see only one variable as stated above. This does not happen via CLI (blade server start).

simonjhy commented 1 year ago

yes, it should be a bug to fix the bundle server start issue when use set jdk 17 as JAVA_HOME from last release. I will try to fix it in next new release.

Elinvention commented 1 year ago

Tomorrow I updated the Liferay plugin to 2.0.5 and I can see that this issue is solved. Thank you very much.