You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Development of Dataverse on Windows has been confirmed to work as long as you use WSL rather than cmd.exe. See [the guides](https://dataverse-guide--11583.org.readthedocs.build/en/11583/developers/dev-environment.html#quickstart), #10606, and #11583.
Copy file name to clipboardExpand all lines: doc/sphinx-guides/source/developers/dev-environment.rst
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,8 @@ After cloning the `dataverse repo <https://github.com/IQSS/dataverse>`_, run thi
18
18
19
19
``mvn -Pct clean package docker:run``
20
20
21
+
(Note that if you are Windows, you must run the command above in `WSL <https://learn.microsoft.com/windows/wsl>`_ rather than cmd.exe. See :doc:`windows`.)
Copy file name to clipboardExpand all lines: doc/sphinx-guides/source/developers/windows.rst
+53-53Lines changed: 53 additions & 53 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,106 +2,106 @@
2
2
Windows Development
3
3
===================
4
4
5
-
Historically, development on Windows is `not well supported <https://groups.google.com/d/msg/dataverse-community/Hs9j5rIxqPI/-q54751aAgAJ>`_ but as of 2023 a container-based approach is recommended.
6
-
7
5
.. contents:: |toctitle|
8
-
:local:
9
-
10
-
Running Dataverse in Docker on Windows
11
-
--------------------------------------
6
+
:local:
12
7
13
-
See the `post <https://groups.google.com/g/dataverse-dev/c/utqkZ7gYsf4/m/4IDtsvKSAwAJ>`_ by Akio Sone for additional details, but please observe the following:
8
+
Running Dataverse in Windows WSL
9
+
--------------------------------
14
10
15
-
- You must have jq installed: https://jqlang.github.io/jq/download/
16
-
- In git, the line-ending setting should be set to always LF (line feed, ``core.autocrlf=input``). Update: This should have been fixed by https://github.com/IQSS/dataverse/pull/10092.
11
+
The simplest method to run Dataverse in Windows 10 and 11 is using Docker and Windows Subsystem for Linux (WSL) - specifically WSL 2.
12
+
Once Docker and WSL are installed, you can follow the :ref:`quickstart instructions <container-dev-quickstart>`.
17
13
18
-
Once the above is all set you can move on to :doc:`/container/dev-usage` in the Container Guide.
14
+
Please note: these instructions have not been extensively tested. They have been found to work with the Ubuntu-24.04 distribution for WSL. If you find any problems, please open an issue at https://github.com/IQSS/dataverse/issues and/or submit a PR to update this guide.
19
15
20
-
Generally speaking, if you're having trouble running a Dataverse dev environment in Docker on Windows, you are highly encouraged to post about it in the #containers channel on Zulip (https://chat.dataverse.org) and join a Containerization Working Group meeting (https://ct.gdcc.io). See also :doc:`/container/intro` in the Container Guide.
16
+
Install Docker Desktop
17
+
~~~~~~~~~~~~~~~~~~~~~~
21
18
22
-
Running Dataverse in Windows WSL
23
-
--------------------------------
19
+
Follow the directions at https://www.docker.com to install Docker Desktop on Windows. If prompted, turn on WSL 2 during installation.
24
20
25
-
It is possible to run Dataverse in Windows 10 and 11 through WSL (Windows Subsystem for Linux).
21
+
Settings you may need in Docker Desktop:
26
22
27
-
Please note: these instructions have not been extensively tested. If you find any problems, please open an issue at https://github.com/IQSS/dataverse/issues.
23
+
* **General/Expose daemon on tcp://localhost:2375 without TLS**: true
24
+
* **General/Use the WSL 2 based engine**: true
25
+
* **General/Add the \*.docker.internal names to the host's /etc/hosts file (Requires password)**: true
26
+
* **Resources/WSL Integration/Enable integration with my default WSL distro**: true
27
+
* **Resources/WSL Integration/Enable integration with additional distros**: select any you run Dataverse in
28
28
29
29
Install WSL
30
30
~~~~~~~~~~~
31
-
If you have Docker already installed, you should already have WSL installed. Otherwise open PowerShell and run:
31
+
If you install Docker Desktop, you should already have WSL installed. If not, or if you wish to add an additional Linux distribution, open PowerShell.
32
32
33
+
If WSL itself is not installed run:
34
+
33
35
.. code-block:: powershell
34
36
35
37
wsl --install
36
38
37
-
If you already had WSL installed you can install a specific Linux distribution:
39
+
For use with Docker, you should use WSL v2 - run:
38
40
39
-
See the list of possible distributions:
41
+
.. code-block:: powershell
42
+
43
+
wsl --set-default-version 2
44
+
45
+
Install a specific Linux distribution. To see the list of possible distributions:
40
46
41
47
.. code-block:: powershell
42
48
43
49
wsl --list --online
44
50
45
-
Choose the distribution you would like. Then run the following command. These instructions were tested with Ubuntu.
51
+
Choose the distribution you would like. Then run the following command. These instructions were tested with ``Ubuntu 24.04 LTS``.
46
52
47
53
.. code-block:: powershell
48
54
49
55
wsl --install -d <Distribution Name>
50
56
51
-
You will be asked to create a Linux user.
52
-
After the installation of Linux is complete, check that you have an Internet connection:
57
+
You will be asked to create an initial Linux user.
53
58
54
-
.. code-block:: bash
59
+
.. note::
60
+
Using wsl --set-version to upgrade an existing distribution from WSL 1 to WSL 2 may not work - installing a new distribution using WSL 2 is recommended.
61
+
62
+
Prepare WSL
63
+
~~~~~~~~~~~
55
64
56
-
ping www.google.com
65
+
Once that you have WSL installed, You will need Java and MVN working inside WSL, how you go about this will depend on the Linux distribution you installed in WSL.
57
66
58
-
If you do not have an Internet connection, try adding it in ``/etc/wsl.conf``
67
+
Here is an example using SDKMAN, which is not required, but it is recommended for managing Java and other SDKs.
59
68
60
69
.. code-block:: bash
61
-
62
-
[network]
63
-
generateResolvConf = false
64
70
65
-
Also in ``/etc/resolv.conf`` add
71
+
sudo apt update
72
+
sudo apt install zip
66
73
67
74
.. code-block:: bash
68
75
69
-
nameserver 1.1.1.1
70
-
71
-
Now you can install all the tools one usually uses in Linux. For example, it is good idea to run an update:
76
+
sudo apt update
77
+
sudo apt install unzip
72
78
73
79
.. code-block:: bash
74
80
75
-
sudo apt update
76
-
sudo apt full-upgrade -y
81
+
curl -s "https://get.sdkman.io"| bash
82
+
source"$HOME/.sdkman/bin/sdkman-init.sh"
77
83
78
-
Install Dataverse
79
-
~~~~~~~~~~~~~~~~~
84
+
.. code-block:: bash
85
+
86
+
sdk install java 17.0.7-tem
80
87
81
-
Now you can install Dataverse in WSL following the instructions for :doc:`classic-dev-env`
82
-
At the end, check that you have ``-Ddataverse.pid.default-provider=fake`` in jvm-options.
88
+
.. code-block:: bash
83
89
84
-
Now you can access Dataverse in your Windows browser (Edge, Chrome, etc.):
90
+
sdk install maven
85
91
86
-
- http://localhost:8080
87
-
- username: dataverseAdmin
88
-
- password: admin
92
+
Install Dataverse
93
+
~~~~~~~~~~~~~~~~~
89
94
90
-
IDE for Dataverse in Windows
91
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
92
-
Files in WSL are accessible from Windows for editing using ``\\wsl.localhost`` or ``\\wsl$`` path. Windows files are accessible under Linux in the ``/mnt/c/`` directory. Therefore one can use one's favorite editor or IDE to edit Dataverse project files. Then one can build using ``mvn`` in WSL and deploy manually in WSL using ``asadmin``.
95
+
Open a Linux terminal (e.g. use Windows Terminal and open a tab for the Linux distribution you selected). Then install Dataverse in WSL following the :ref:`quickstart instructions <container-dev-quickstart>`. You should then have a working Dataverse instance.
93
96
94
-
It is still though possible to use a full-strength IDE. The following instructions are for IntelliJ users.
97
+
We strongly recommend that you clone the Dataverse repository from WSL, not from Windows. This will ensure that builds are much faster.
95
98
96
-
- Install Intelij in Windows.
99
+
IDEs for Dataverse in Windows
100
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
97
101
98
-
You can open the project through ``\\wsl.localhost`` and navigate to the Dataverse project.
99
-
You can try to build the project in IntelliJ. You may get a message ``Cannot establish network connection from WSL to Windows host (could be blocked by the firewall).`` In that case you can try
100
-
to disable WSL Hyperviser from the firewall.
101
-
After that you should be able to build the project in IntelliJ.
102
-
It seems that at present it is impossible to deploy the Glassfish application in IntelliJ. You can try to add a Glassfish plugin through Settings->Plugins and in Run->Edit Configurations configure Application Server from WSL ``/usr/localhost/payara6`` with URL http://localhost:8080 and Server Domain as domain1, but it may fail since IntelliJ confuses the Windows and Linux paths.
102
+
You can use your favorite editor or IDE to edit Dataverse project files. Files in WSL are accessible from Windows for editing using the path ``\\wsl.localhost``. Your Linux distribution files should also be visible in File Explorer under the This PC/Linux entry.
103
103
104
-
To use the full strength of Intelij with build, deployment and debugging, one will need to use Intelij ``Remote development``. Close all the projects in IntelliJ and go to ``Remote development->WSL`` and press ``New Project``. In WSL instance choose your Linux distribution and press ``Next``. In ``Project Directory`` navigate to WSL Dataverse project. Then press ``Download IDE and Connect``. This will install IntelliJ in WSL in ``~/.cache/JetBrains/``. Now in IntelliJ you should see your project opened in a new IntelliJ window. After adding the Glassfish plugin and editing your configuration you should be able to build the project and run the project.
104
+
.. note:: FYI: For the best performance, it is recommended, with WSL 2, to store Dataverse files in the WSL/Linux file system and to access them from there with your Windows-based IDE (versus storing Dataverse files in your Windows file system and trying to run maven and build from Linux - access to /mnt/c files using WSL 2 is slow).
105
105
106
106
pgAdmin in Windows for Dataverse
107
107
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -110,4 +110,4 @@ You can access the Dataverse database from Windows.
110
110
111
111
Install pgAdmin from https://www.pgadmin.org/download/pgadmin-4-windows/
112
112
113
-
In pgAdmin, register a server using 127.0.0.1 with port 5432, database dvndb and dvnapp as username with secret password. Now you will be able to accessand update the Dataverse database.
113
+
In pgAdmin, register a server using ``127.0.0.1`` with port ``5432``. For the database name, username, and password, see :ref:`db-name-creds`. Now you will be able to access, monitor, and update the Dataverse database.
0 commit comments